W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2014

Re: Determining what prototype should be used for an object

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Fri, 14 Nov 2014 12:33:30 -0500
Message-ID: <54663CEA.7050602@mit.edu>
To: Allen Wirfs-Brock <allen@wirfs-brock.com>, Anne van Kesteren <annevk@annevk.nl>
CC: Domenic Denicola <d@domenic.me>, "public-script-coord@w3.org" <public-script-coord@w3.org>
On 11/14/14, 12:00 PM, Allen Wirfs-Brock wrote:
>>    var x = new self[0].Array()
>>    w(isObjectFromGlobal(x, self[0]))
>>    x = Array.prototype.constructor.call(self[0])
>>    w(isObjectFromGlobal(x, self[0]))
>
> according to the ES6 spec.
>    new Array()
> and
>     Array.prototype.constructor.call(anything)
> both produce objects whose [[Prototype]] are in the same realm as Array.  So the answer should yield true, true.

No, because the quoted code is using two different Array constructors. 
To per ES spec "true, false" is correct.

-Boris
Received on Friday, 14 November 2014 17:34:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:23 UTC