New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding an informative note about the immutability of the arguments binding in strict functions #521

Open
ajklein opened this Issue Apr 6, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@ajklein
Contributor

ajklein commented Apr 6, 2016

In step 22.c of https://tc39.github.io/ecma262/#sec-functiondeclarationinstantiation, the spec goes out of its way to call CreateImmutableBinding when creating the binding for the arguments object for a strict function. Given that, in strict mode, any assignment to arguments is an early error, the fact that the binding is immutable is completely unobservable (so would it being mutable, for that matter).

I think it might be useful to, at the least, have a NOTE here that there will never be an attempt to mutate this binding. I could also imagine removing the if statement entirely and always using CreateMutableBinding, along with the same NOTE about strict mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment