Re: @@symbol hooks and cross domain frames

On 7/9/15 9:47 AM, Erik Arvidsson wrote:
> In ES5 the following works:
>
>    [].concat(windowFromOtherDomain)
>
> But in ES6 it fails because reading @@isConcatSpreadable throws an
> access denied error.

Good catch.

We should consider just making @@isConcatSpreadable on a cross-origin 
window work and return undefined.  This doesn't require any chances to 
ES, just to the DOM-defined behavior of cross-origin windows, and should 
give us the desired behavior, right?

> Similar issues arise with @@toStringTag and @@hasInstance

I think @@toStringTag should also simply return undefined on a 
cross-origin window.  This will give us the desired behavior of "[object 
Object]".

@@hasInstance can just throw; I can't see any use cases for having a 
cross-origin window on the _right-hand_ side of instanceof, which is 
where the @@hasInstance call happens.

> There might also be similar issues with Get(x, "constructor") and
> @@species but I believe all of them might be better of throwing.

I think throwing for those is eminently reasonable.

-Boris

Received on Thursday, 9 July 2015 18:54:28 UTC