RE: Determining what prototype should be used for an object

Very interesting...

From: Boris Zbarsky [mailto:bzbarsky@mit.edu] 

> In ES, the answer typically seems to be "the global of the current Realm".  But in ES it's also not common for built-in functions to create objects and keep returning them, for what it's worth.

> for the most part in browsers today IDL-defined methods that create objects will create the object using the global environment that the "this"  value for the method is associated with.  This is the global environment it initially got its prototype from, except in some cases for nodes when adoptNode is involved.

Just to sharpen the discussion, it would help to give one example of each...

Honestly the WebIDL answer sounds pretty reasonable to me, so I am interested in where ES mismatches.

Received on Friday, 14 November 2014 11:32:17 UTC