archives

« Bugzilla Issues Index

#4277 — 14.2.16: Misleading non-normative note


The non-normative note for 14.2.16 ("Runtime Semantics: Evaluation") states:

> An ArrowFunction does not define local bindings for arguments, super, this, or
> new.target.

While it is true that ArrowFunctions do not *intrinsically* define local bindings for `arguments`, this is not true for arrow functions where `arguments` appears as a formal parameter. 9.2.12 "FunctionDeclarationInstantiation(func, argumentsList)" defines the behavior of arguments objects and named parameters in this context:

https://people.mozilla.org/%7Ejorendorff/es6-draft.html#sec-functiondeclarationinstantiation

For example:

var f = (arguments) => arguments;

While this distinction might amount to nitpicking as it concerns the first sentence in the note, the sentence immediately following is much more clearly incorrect:

> Any reference to arguments, super, or this within an ArrowFunction must
> resolve to a binding in a lexically enclosing environment.

...in these cases, `arguments` resolves to a binding within the ArrowFunction's lexical environment (as created via FunctionDeclarationInstantiation).


Maybe a more compelling example (to the extent that this bug can be called "compelling"):

function f() {
return (arguments) => arguments;
}