{"action":"created","issue":{"url":"https://api.github.com/repos/marijnh/acorn/issues/335","labels_url":"https://api.github.com/repos/marijnh/acorn/issues/335/labels{/name}","comments_url":"https://api.github.com/repos/marijnh/acorn/issues/335/comments","events_url":"https://api.github.com/repos/marijnh/acorn/issues/335/events","html_url":"https://github.com/marijnh/acorn/pull/335","id":111698310,"number":335,"title":"Ensure that rest elements can only be identifiers in functions","user":{"login":"nzakas","id":38546,"avatar_url":"https://avatars.githubusercontent.com/u/38546?v=3","gravatar_id":"","url":"https://api.github.com/users/nzakas","html_url":"https://github.com/nzakas","followers_url":"https://api.github.com/users/nzakas/followers","following_url":"https://api.github.com/users/nzakas/following{/other_user}","gists_url":"https://api.github.com/users/nzakas/gists{/gist_id}","starred_url":"https://api.github.com/users/nzakas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzakas/subscriptions","organizations_url":"https://api.github.com/users/nzakas/orgs","repos_url":"https://api.github.com/users/nzakas/repos","events_url":"https://api.github.com/users/nzakas/events{/privacy}","received_events_url":"https://api.github.com/users/nzakas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-15T20:14:19Z","updated_at":"2015-10-15T20:48:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/marijnh/acorn/pulls/335","html_url":"https://github.com/marijnh/acorn/pull/335","diff_url":"https://github.com/marijnh/acorn/pull/335.diff","patch_url":"https://github.com/marijnh/acorn/pull/335.patch"},"body":"This one was a bit more involved. My general approach was to keep all functions working as they currently are and add one more parameter, where appropriate, to check for situations where rest elements must be identifiers.\r\n\r\nFixes #334"},"comment":{"url":"https://api.github.com/repos/marijnh/acorn/issues/comments/148516336","html_url":"https://github.com/marijnh/acorn/pull/335#issuecomment-148516336","issue_url":"https://api.github.com/repos/marijnh/acorn/issues/335","id":148516336,"user":{"login":"nzakas","id":38546,"avatar_url":"https://avatars.githubusercontent.com/u/38546?v=3","gravatar_id":"","url":"https://api.github.com/users/nzakas","html_url":"https://github.com/nzakas","followers_url":"https://api.github.com/users/nzakas/followers","following_url":"https://api.github.com/users/nzakas/following{/other_user}","gists_url":"https://api.github.com/users/nzakas/gists{/gist_id}","starred_url":"https://api.github.com/users/nzakas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzakas/subscriptions","organizations_url":"https://api.github.com/users/nzakas/orgs","repos_url":"https://api.github.com/users/nzakas/repos","events_url":"https://api.github.com/users/nzakas/events{/privacy}","received_events_url":"https://api.github.com/users/nzakas/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T20:48:08Z","updated_at":"2015-10-15T20:48:08Z","body":"Yeah, they can be in destructuring:\r\n\r\n```js\r\nvar [a, ...[b, c]] = x;\r\n```\r\n\r\nThat's also a `RestElement`, but has a different grammar:\r\n\r\n```\r\nAssignmentRestElement[Yield] :\r\n    ... DestructuringAssignmentTarget[?Yield]\r\n\r\nDestructuringAssignmentTarget[Yield] :\r\n    LeftHandSideExpression[?Yield]\r\n```\r\n\r\nBoth this, and the function params, are represented by `RestElement` in ESTree."}}