{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel/issues/2527","labels_url":"https://api.github.com/repos/babel/babel/issues/2527/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/2527/comments","events_url":"https://api.github.com/repos/babel/babel/issues/2527/events","html_url":"https://github.com/babel/babel/issues/2527","id":111049809,"number":2527,"title":"Destructuring a function arguments within an array does not cause SyntaxError","user":{"login":"jakecraige","id":3799709,"avatar_url":"https://avatars.githubusercontent.com/u/3799709?v=3","gravatar_id":"","url":"https://api.github.com/users/jakecraige","html_url":"https://github.com/jakecraige","followers_url":"https://api.github.com/users/jakecraige/followers","following_url":"https://api.github.com/users/jakecraige/following{/other_user}","gists_url":"https://api.github.com/users/jakecraige/gists{/gist_id}","starred_url":"https://api.github.com/users/jakecraige/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakecraige/subscriptions","organizations_url":"https://api.github.com/users/jakecraige/orgs","repos_url":"https://api.github.com/users/jakecraige/repos","events_url":"https://api.github.com/users/jakecraige/events{/privacy}","received_events_url":"https://api.github.com/users/jakecraige/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-12T20:29:57Z","updated_at":"2015-10-12T20:54:25Z","closed_at":null,"body":"Today I came across what looks like a bug. \r\n\r\nIf you try to destructure arguments to a function that's within an array it silently fails instead of giving a SyntaxError.\r\n\r\nThe failing code looks like:\r\n\r\n```js\r\nconst doesntCompileProperly = [\r\n  ...args => console.log(args)\r\n];\r\n```\r\n\r\nand compiles to:\r\n\r\n```js\r\nvar doesntCompileProperly = [].concat(_toConsumableArray(function (args) {\r\n  return console.log(args);\r\n}));\r\n```\r\n\r\nHere's a link to a few other examples in the Babel repl: [babeljs.io repl link](http://babeljs.io/repl/#?experimental=false&evaluate=true&loose=false&spec=false&code=const%20compilesAsExpected%20%3D%20%5B%0A%20%20(...args)%20%3D%3E%20console.log(args)%0A%5D%3B%0A%0Aconst%20doesntCompileProperly%20%3D%20%5B%0A%20%20...args%20%3D%3E%20console.log(args)%0A%5D%3B%0A%0A%2F%2F%20const%20syntaxErrorInObject%20%3D%20%7B%0A%2F%2F%20%20%20something%3A%20...args%20%3D%3E%20console.log(args)%0A%2F%2F%20%7D%3B%0A%0A%2F%2F%20const%20syntaxErrorByItself%20%3D%20...args%20%3D%3E%20console.log(args))"},"comment":{"url":"https://api.github.com/repos/babel/babel/issues/comments/147517472","html_url":"https://github.com/babel/babel/issues/2527#issuecomment-147517472","issue_url":"https://api.github.com/repos/babel/babel/issues/2527","id":147517472,"user":{"login":"jridgewell","id":112982,"avatar_url":"https://avatars.githubusercontent.com/u/112982?v=3","gravatar_id":"","url":"https://api.github.com/users/jridgewell","html_url":"https://github.com/jridgewell","followers_url":"https://api.github.com/users/jridgewell/followers","following_url":"https://api.github.com/users/jridgewell/following{/other_user}","gists_url":"https://api.github.com/users/jridgewell/gists{/gist_id}","starred_url":"https://api.github.com/users/jridgewell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jridgewell/subscriptions","organizations_url":"https://api.github.com/users/jridgewell/orgs","repos_url":"https://api.github.com/users/jridgewell/repos","events_url":"https://api.github.com/users/jridgewell/events{/privacy}","received_events_url":"https://api.github.com/users/jridgewell/received_events","type":"User","site_admin":false},"created_at":"2015-10-12T20:54:25Z","updated_at":"2015-10-12T20:54:25Z","body":"You need to wrap a rest parameter with an arrow function, you have to wrap the parameters.\r\n\r\n```js\r\n(...args) => console.log(args)\r\n```"}}