Re: Multiple globals and direct/indirect eval

2011-03-04 Thread David Bruant
[Adding WhatWG and public-script-coord (WebIDL) to the discussion. Discussion is ongoing : - Start of thread : https://mail.mozilla.org/pipermail/es-discuss/2011-March/012915.html - Strawman by Dave Herman: http://wiki.ecmascript.org/doku.php?id=strawman:multiple_globals )] ---

Re: [whatwg] Multiple globals and direct/indirect eval

2011-03-04 Thread Allen Wirfs-Brock
On Mar 4, 2011, at 8:39 AM, Mark S. Miller wrote: I certainly agree that there needs to be a better interface boundary between w3c/whatwg specs and ECMA specs. Too many issues -- like the semantics of multiple globals -- fall in the gaps between the two organizations. The WebIDL's JS binding

Re: Multiple globals and direct/indirect eval

2011-03-04 Thread Allen Wirfs-Brock
On Mar 3, 2011, at 9:22 PM, David Herman wrote: Thus we are left with the IE9/Opera behavior, which seems sensible and natural to me: an eval function should always act in the context of the global from which it came. Now this I think I don't agree with. The reason is that direct eval

Multiple globals and direct/indirect eval

2011-03-03 Thread Jeff Walden
A few months back I noticed an interesting interaction between how direct eval is defined and multiple globals. What happens if, in one global, you call an eval from another global as if it were a direct eval? var indirect = otherGlobal.eval; eval = indirect; print(eval(this) === this);

Re: Multiple globals and direct/indirect eval

2011-03-03 Thread Allen Wirfs-Brock
Jeff, I think your real question reduces to this: //none strict mode code globalObj= function() {return this}(); print(otherGlobal.eval(this) === globalObj) //?? The two different calls and the indirect name in your example may make the question seen like it is about something else

Re: Multiple globals and direct/indirect eval

2011-03-03 Thread Jeff Walden
On 03/03/2011 04:41 PM, Allen Wirfs-Brock wrote: I think your real question reduces to this: //none strict mode code globalObj= function() {return this}(); print(otherGlobal.eval(this) === globalObj) //?? The two different calls and the indirect name in your example may make the question

Re: Multiple globals and direct/indirect eval

2011-03-03 Thread Allen Wirfs-Brock
On Mar 3, 2011, at 5:45 PM, Jeff Walden wrote: On 03/03/2011 04:41 PM, Allen Wirfs-Brock wrote: I think your real question reduces to this: //none strict mode code globalObj= function() {return this}(); print(otherGlobal.eval(this) === globalObj) //?? The two different calls and the

Re: Multiple globals and direct/indirect eval

2011-03-03 Thread David Herman
Hi Jeff, I agree that the spec should deal with multiple global objects. I'm aware of a few of the subtleties of multiple globals, but I wouldn't be surprised if there are more. Thanks for raising this one. I created a placeholder strawman last week, because I've been intending to get into