Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upConsider adding an informative note about the immutability of the arguments binding in strict functions #521
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ajklein commentedApr 6, 2016
In step 22.c of https://tc39.github.io/ecma262/#sec-functiondeclarationinstantiation, the spec goes out of its way to call
CreateImmutableBindingwhen creating the binding for theargumentsobject for a strict function. Given that, in strict mode, any assignment toargumentsis 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.