Re: Problems with strict-mode caller poisoning

2012-11-29 Thread Dave Fugate
The intention was definitely to test step 2 which this particular test doesn't hit. Looks like other 'step 2' tests do though: 6 http://hg.ecmascript.org/tests/test262/file/53c4ade82d14/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-2gs.js#l6 /** 7

Re: Problems with strict-mode caller poisoning

2012-11-29 Thread Dave Fugate
Should be: 'caller' to false :) On Thu, Nov 29, 2012 at 9:10 AM, Dave Fugate dave.fug...@gmail.com wrote: 'caller' to true ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Problems with strict-mode caller poisoning

2012-11-29 Thread Andreas Rossberg
Or to null, which is exactly what the new semantics decided to do. ;) /Andreas On 29 November 2012 17:11, Dave Fugate dave.fug...@gmail.com wrote: Should be: 'caller' to false :) On Thu, Nov 29, 2012 at 9:10 AM, Dave Fugate dave.fug...@gmail.com wrote: 'caller' to true

Re: Problems with strict-mode caller poisoning

2012-11-28 Thread Andreas Rossberg
On 29 November 2012 00:16, Dave Fugate dave.fug...@gmail.com wrote: Believe you're correct on the former, but perhaps not the latter=) E.g.: 6 /** 7* @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-1gs.js 8* @description Strict mode - checking access to strict function

Re: Problems with strict-mode caller poisoning

2012-11-28 Thread Dave Fugate
The naming 'gNonStrict' here refers to the function not containing a use strict declaration itself, not that it's subject to strict mode. Sorry this intent wasn't clearer. Section 15.3.5.4 step 2 in my copy of ES5 http://es5.github.com/#x15.3.5.4 reads: If *P* is *caller *and *v* is a strict

Re: Problems with strict-mode caller poisoning

2012-11-28 Thread Andreas Rossberg
On 29 November 2012 06:06, Dave Fugate dave.fug...@gmail.com wrote: The naming 'gNonStrict' here refers to the function not containing a use strict declaration itself, not that it's subject to strict mode. Sorry this intent wasn't clearer. Section 15.3.5.4 step 2 in my copy of ES5 reads:

Re: Problems with strict-mode caller poisoning

2012-11-22 Thread Andreas Rossberg
On 20 November 2012 17:26, Allen Wirfs-Brock al...@wirfs-brock.com wrote: Yes, property descriptor records can't act like accessors. They are just specification internal records that indicate that a set of values is being passed around. But we can censor the value that goes into the record.

Re: Problems with strict-mode caller poisoning

2012-11-21 Thread Brendan Eich
Allen Wirfs-Brock wrote: On 11/16/2012 07:06 AM, Brendan Eich wrote: So it seems to me premature to throw on [[GetOwnProperty]] of a strict function's 'caller'. It would be more precise, and avoid the problem you're hitting, to return a property descriptor with a censored .value,

Re: Problems with strict-mode caller poisoning

2012-11-20 Thread Andreas Rossberg
On 16 November 2012 22:19, Jeff Walden jwalden...@mit.edu wrote: On 11/16/2012 07:06 AM, Brendan Eich wrote: So it seems to me premature to throw on [[GetOwnProperty]] of a strict function's 'caller'. It would be more precise, and avoid the problem you're hitting, to return a property

Re: Problems with strict-mode caller poisoning

2012-11-20 Thread Allen Wirfs-Brock
On Nov 20, 2012, at 4:01 AM, Andreas Rossberg wrote: On 16 November 2012 22:19, Jeff Walden jwalden...@mit.edu wrote: On 11/16/2012 07:06 AM, Brendan Eich wrote: So it seems to me premature to throw on [[GetOwnProperty]] of a strict function's 'caller'. It would be more precise, and avoid

Re: Problems with strict-mode caller poisoning

2012-11-17 Thread Brendan Eich
On 11/16/2012 01:19 PM, Jeff Walden wrote: Too many function referents in play in all this discussion. :-\ Indeed! Care to update https://bugs.ecmascript.org/show_bug.cgi?id=310 with a pellucid proposal along these lines? :-) /be ___

Problems with strict-mode caller poisoning

2012-11-16 Thread Andreas Rossberg
Consider the following code: function f() { use strict; g() } function g() { var caller = Object.getOwnPropertyDescriptor(g, caller).value } With the current spec, this code would legally give g the strict function f as its caller. In

Re: Problems with strict-mode caller poisoning

2012-11-16 Thread Brendan Eich
Andreas Rossberg wrote: Consider the following code: function f() { use strict; g() } function g() { var caller = Object.getOwnPropertyDescriptor(g, caller).value } With the current spec, this code would legally give g the strict function f as its caller. In

Re: Problems with strict-mode caller poisoning

2012-11-16 Thread Jeff Walden
On 11/16/2012 07:06 AM, Brendan Eich wrote: d8 function g() { Object.seal(g) } d8 function f() { use strict; g() } d8 f() (d8):1: TypeError: Illegal access to a strict mode caller function. (Interestingly, Firefox does not throw on that example, so I'm not sure what semantics it actually

Re: Problems with strict-mode caller poisoning

2012-11-16 Thread Jeff Walden
On 11/16/2012 01:19 PM, Jeff Walden wrote: and to defer all the strictness checks to when the function provided as |this| is actually invoked. Er, that should be and to have the 'caller' [[Get]] function check the strictness of the |this| function provided to it when that [[Get]] function is