Annex B.3.3 substantially changes strict vs non-strict semantics

2016-01-19 Thread Kevin Gibbons
I'm not sure if this is well-known; it was certainly surprising to me. Consider the following program: `let func = () => 0; (function(){ { function func() { return 1; } } return func(); })();` The return value of the second function depends on whether this program is

Re: Annex B.3.3 substantially changes strict vs non-strict semantics

2016-01-19 Thread Mark S. Miller
On Tue, Jan 19, 2016 at 9:54 AM, Kevin Gibbons wrote: > I'm not sure if this is well-known; it was certainly surprising to me. > > Consider the following program: > `let func = () => 0; > > (function(){ > { > function func() { > return 1; > } > } >

Re: Annex B.3.3 substantially changes strict vs non-strict semantics

2016-01-19 Thread Andrea Giammarchi
FWIW I think that's expected. Strict mode would throw otherwise but of course if you have an outer scope reference to whatever you are invoking that's indeed what you invoke. Making it behave similarly in both strict and non strict would be a mistake for the existing sloppy code but I agree that