Skip to content

Instantly share code, notes, and snippets.

@mroch
Created November 14, 2013 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mroch/7471758 to your computer and use it in GitHub Desktop.
Save mroch/7471758 to your computer and use it in GitHub Desktop.
Arrow function parameters
eval => 42; // ok
(eval) => 42; // ok
(eval, a) => 42; // ok
(a, a) => 42; // Syntax error per 14.1.1 (StrictFormalParameters : FormalParameters)
"use strict"; (eval) => 42; // Syntax error per 14.2.10
(eval) => { "use strict"; }; // Syntax error per 14.2.10
// Syntax errors per 14.1.1 (FormalParameters : FormalParameterList), since IsSimpleParameterList is false
// This is changing to be allowed?
(eval, a = 10) => 42;
(eval = 10) => 42;
@allenwb
Copy link

allenwb commented Nov 14, 2013

yes to line 10. I've removed that rule. so lines 11 and 12 are ok, but these will be syntax errors as a script:

"use strict"; (eval, a = 10) => 42;
"use strict"; (eval = 10) => 42;

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