>/  Brandon Benvie <mailto:bbenvie at mozilla.com  
<https://mail.mozilla.org/listinfo/es-discuss>>
/>/  September 30, 2013 8:48 PM
/>/  I'm actually now really curious what the following does:
/>/
/>/  ```
/>/  function foo(x, y = (() => { arguments[0] = "foo"; return "bar" })()) {
/>/    return [x, y];
/>/  }
/
Easy: arguments is an early error in the body of an arrow.

http://wiki.ecmascript.org/doku.php?id=harmony:arrow_function_syntax

/be

This restriction is not specified in the rev19 draft. Currently arrow functions don't have an own `arguments` binding, but instead access the outer functions `arguments` object, similar to `this`. Disallowing the identifier "arguments" in PrimaryExpressions also should imply disallowing "arguments" as a BindingIdentifier, which shifts arrow functions again into "almost strict-mode".

- André
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to