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
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;
> }
> }
>
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
3 matches
Mail list logo