Function-Scoped Functions aren't an ES6 feature
webbedspace opened this issue · comments
Placing a function declaration inside another function declaration has been valid JavaScript since Netscape 2.0, and moreover has never been disallowed by strict mode.
Yes, but not in strict mode since ES5. That's the point here. But I've made it more explicit now. Thanks for the feedback.
I just said:
it has never been disallowed by strict mode.
The only thing strict mode disallowed was block-scoped function declarations. Not function-scoped function declarations.
To summarise:
ALLOWED IN ES5:
"use strict"; function A() { function B() {} }
NOT ALLOWED IN ES5:
"use strict"; { function B() {} }
Ah, understood. You're right, I was wrong here. Now fixed. Thanks for clarification.