In ES6 slice returns an object that is determine based upon the actual this value passed to slice. The problem is that in ES<6 slice always returned a new Array instance using the Array of the realm associated with the invoked slice function. instanceof is not a reliable test for array-ness when objects flow between realms. var g = newGlobal( "new-compartment") //or any non-standard mechanism to get a handle on another realm's global objectĪlso note that if the instanceof tests above were replaced with Array.isArray(g.a) you would get all trues in both ES5 and ES6. Here is one of the test cases André is talking about.
0 Comments
Leave a Reply. |