Array.prototype.slice web-compat issue?

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Sep 10 18:15:43 PDT 2013


On Sep 10, 2013, at 6:08 PM, Boris Zbarsky wrote:

> On 9/10/13 8:50 PM, Allen Wirfs-Brock wrote:
>> And what does [[Class]] == "Array" actually tell you?
> 
> What will happen when you structured clone or JSON.stringify the object, the length invariant, and what happens if you pass it as an argument to Array.prototype.concat are the main things.

Exactly the same thing as ES5 (its all in the ES6 spec.).
"obj is an exotic array object" is ES6-speak that means the same things as the ES5-speak "obj's [[Class]] is "Array".

In either case, all objects that pass one of the above predicates implements the array length invariant.

ES6 doesn't prescribe how an implementation goes about tagging an object as an "exotic array object".  ES5 didn't prescribe how an implementation actually encoded the [[Class]] internal property.

> 
>>   2) whether an object inherits from Array.prototype
> 
> That one tells you nothing about any of the four things above, indeed.
> 
> -Boris
> 



More information about the es-discuss mailing list