On 2/4/14 12:08 PM, Kevin Reid wrote:
Could not this be done while matching the above principle as follows?

proxyForB, or more precisely the proxy for the function object
(windowB.postMessage), does not actually invoke windowB.postMessage
itself but a corresponding "post message from origin A" function.

That's actually pretty complicated. Now you have two not-object-identical representations of windowB.postMessage in the scope of windowB, no? The current membrane in SpiderMonkey has a single per-global representation of each object, for sanity's sake. As a simple example, consider this code in window A:

  proxyForB.setTimeout(proxyForB.postMessage, 0, 5, "*");

What function object should the setTimeout implementation see? What should happen when the timeout fires?

Or if the distinction should be made using 'this'-values rather than
function values, make it by the function proxy recognizing
this=proxyForB

Ensuring that in the setTimeout case above is not trivial, I expect.

-Boris
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to