{"action":"created","issue":{"url":"https://api.github.com/repos/jquery/esprima/issues/1334","labels_url":"https://api.github.com/repos/jquery/esprima/issues/1334/labels{/name}","comments_url":"https://api.github.com/repos/jquery/esprima/issues/1334/comments","events_url":"https://api.github.com/repos/jquery/esprima/issues/1334/events","html_url":"https://github.com/jquery/esprima/issues/1334","id":108551826,"number":1334,"title":"`let` not allowed as a bound identifier in for-in and for-of loops","user":{"login":"TimothyGu","id":1538624,"avatar_url":"https://avatars.githubusercontent.com/u/1538624?v=3","gravatar_id":"","url":"https://api.github.com/users/TimothyGu","html_url":"https://github.com/TimothyGu","followers_url":"https://api.github.com/users/TimothyGu/followers","following_url":"https://api.github.com/users/TimothyGu/following{/other_user}","gists_url":"https://api.github.com/users/TimothyGu/gists{/gist_id}","starred_url":"https://api.github.com/users/TimothyGu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimothyGu/subscriptions","organizations_url":"https://api.github.com/users/TimothyGu/orgs","repos_url":"https://api.github.com/users/TimothyGu/repos","events_url":"https://api.github.com/users/TimothyGu/events{/privacy}","received_events_url":"https://api.github.com/users/TimothyGu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-27T18:18:49Z","updated_at":"2015-09-29T05:20:03Z","closed_at":null,"body":"```js\r\n> require('esprima').parse('var func = let => 0')\r\nError: Line 1: Unexpected token let\r\n    at constructError (esprima.js:2388:21)\r\n    at createError (esprima.js:2407:17)\r\n    at unexpectedTokenError (esprima.js:2481:13)\r\n    at throwUnexpectedToken (esprima.js:2486:15)\r\n    at parsePrimaryExpression (esprima.js:3255:13)\r\n    at inheritCoverGrammar (esprima.js:2662:18)\r\n    at parseLeftHandSideExpressionAllowCall (esprima.js:3387:20)\r\n    at inheritCoverGrammar (esprima.js:2662:18)\r\n    at parsePostfixExpression (esprima.js:3463:16)\r\n    at parseUnaryExpression (esprima.js:3523:20)\r\n```\r\n\r\nAs far as I can tell, `let` is a valid Identifier and BindingIdentifier under non-strict mode, and therefore it should be allowed as a parameter.\r\n\r\n----\r\n\r\nES2015 [14.2](http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions):\r\n\r\n> ```\r\nArrowFunction[In, Yield] :\r\n    ArrowParameters[?Yield] [no LineTerminator here] => ConciseBody[?In]\r\nArrowParameters[Yield] :\r\n    BindingIdentifier[?Yield]\r\n    CoverParenthesizedExpressionAndArrowParameterList[?Yield]\r\n```\r\n\r\nES2015 [12.2](http://www.ecma-international.org/ecma-262/6.0/#sec-primary-expression):\r\n\r\n> ```\r\nCoverParenthesizedExpressionAndArrowParameterList[Yield] :\r\n    ( Expression[In, ?Yield] )\r\n    ( )\r\n    ( ... BindingIdentifier[?Yield] )\r\n    ( Expression[In, ?Yield] , ... BindingIdentifier[?Yield] )\r\n```\r\n\r\nES2015 [12.1](http://www.ecma-international.org/ecma-262/6.0/#sec-identifiers):\r\n\r\n> ```\r\nBindingIdentifier[Yield] :\r\n    Identifier\r\n    [~Yield] yield\r\n>\r\nIdentifier :\r\n    IdentifierName but not ReservedWord\r\n```\r\n\r\nES2015 [12.1.1](http://www.ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors)\r\n\r\n> ```\r\nBindingIdentifier : Identifier\r\n   * It is a Syntax Error if the code matched by this production is contained in strict mode code and the StringValue of Identifier is \"arguments\" or \"eval\".\r\n> \r\nIdentifier : IdentifierName but not ReservedWord\r\n    * It is a Syntax Error if this phrase is contained in strict mode code and the StringValue of IdentifierName is: \"implements\", \"interface\", \"let\", \"package\", \"private\", \"protected\", \"public\", \"static\", or \"yield\".\r\n    * It is a Syntax Error if StringValue of IdentifierName is the same String value as the StringValue of any ReservedWord except for yield.\r\n```"},"comment":{"url":"https://api.github.com/repos/jquery/esprima/issues/comments/143947704","html_url":"https://github.com/jquery/esprima/issues/1334#issuecomment-143947704","issue_url":"https://api.github.com/repos/jquery/esprima/issues/1334","id":143947704,"user":{"login":"TimothyGu","id":1538624,"avatar_url":"https://avatars.githubusercontent.com/u/1538624?v=3","gravatar_id":"","url":"https://api.github.com/users/TimothyGu","html_url":"https://github.com/TimothyGu","followers_url":"https://api.github.com/users/TimothyGu/followers","following_url":"https://api.github.com/users/TimothyGu/following{/other_user}","gists_url":"https://api.github.com/users/TimothyGu/gists{/gist_id}","starred_url":"https://api.github.com/users/TimothyGu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimothyGu/subscriptions","organizations_url":"https://api.github.com/users/TimothyGu/orgs","repos_url":"https://api.github.com/users/TimothyGu/repos","events_url":"https://api.github.com/users/TimothyGu/events{/privacy}","received_events_url":"https://api.github.com/users/TimothyGu/received_events","type":"User","site_admin":false},"created_at":"2015-09-29T05:20:03Z","updated_at":"2015-09-29T05:20:03Z","body":"Ah okay. Didn't see \"[lookahead ≠ let ]\" in the spec."}}