Ok thank you I will test it.

Am 12.01.2014 15:30, schrieb Till Schneidereit:
> On Sun, Jan 12, 2014 at 2:36 PM, Andreas Schlegel
> <[email protected] <mailto:[email protected]>> wrote:
>
>>     I don't know your code, so this is somewhat speculative, but: if
>>     you create an object (in your case a proxy, IINM) in one global
>>     and then do a comparison with another object from another global,
>>     that should blow up or give false results if you don't
>>     specifically handle these cases. If it doesn't, then your code is
>>     set up so that the comparison happens after some other code has
>>     already done the required unwrapping for you. In that case,
>>     great, but you might want to test in the browser, too, by
>>     creating multiple iframes and comparing objects from two of them.
>     I'm not so good in JavaScript, how can I assign the values to the
>     globals for testing? For my case the "transparent" proxies are
>     only the same, if the targets have the same identity.
>
>     var global1 = newGlobal();
>     evalcx('var obj = {foo:"bar"}', global1);
>     evalcx('var proxy1= new Proxy(obj)', global1);
>     var global2 = newGlobal();
>     evalcx('var proxy2= new Proxy(obj)', global2);
>     reportCompare(true, proxy1 == proxy2);
>
>     Is this correct?
>
>
> Almost. Your proxies don't specify handler object (which can be
> empty), and your second global doesn't contain the obj. Also, you
> don't need to create two new globals, as the main script is already
> running in one.
>
> Here's a version that does both an object and a proxy comparison:
>
> var obj = {foo:"bar"};
> var proxy = new Proxy(obj, {});
> var global = newGlobal();
> global.obj = obj;
> evalcx('var proxy = new Proxy(obj, {})', global);
> print(obj == global.obj); // prints true
> print(proxy == global.proxy); // prints false
>
> IIUC, the second print should also be true with your work applied.
>  
>
>     At the moment I've only installed the Spidermonkey Engine, can I
>     test the behaviour without a browser?
>
>
> Yes, largely. The browser uses different cross-compartment wrappers,
> which might or might not mean that your code has to do something
> different. For your exploratory work, testing in the shell should be
> fine, though.
>  

_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to