Closed Bug 914695 Opened 11 years ago Closed 10 years ago

Arrow functions should not create an "arguments" binding

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 889158

People

(Reporter: wingo, Unassigned)

Details

I am told that SM's arrow functions create an arguments binding.  That should not be the case; see http://people.mozilla.org/~jorendorff/es6-draft.html#sec-9.1.16.11, step 7.  Arrow functions have "lexical" type.
The spec link appears to have changed.  I think this is current: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-arrow-function-definitions-runtime-semantics-evaluation

In this example, the arrow function should ignore the "2" passed to it and print the "1" passed to the lexically enclosing function instead.

function f() {
  return (() => arguments[0])(2);
}
console.log(f(1)); // prints "2"; should print "1"
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
Assignee: general → nobody
Is this a dupe of #889158 ?
Yeah, think so.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
You need to log in before you can comment on or make changes to this bug.