{"action":"closed","issue":{"url":"https://api.github.com/repos/google/closure-compiler/issues/2014","repository_url":"https://api.github.com/repos/google/closure-compiler","labels_url":"https://api.github.com/repos/google/closure-compiler/issues/2014/labels{/name}","comments_url":"https://api.github.com/repos/google/closure-compiler/issues/2014/comments","events_url":"https://api.github.com/repos/google/closure-compiler/issues/2014/events","html_url":"https://github.com/google/closure-compiler/issues/2014","id":177293740,"number":2014,"title":"Simple Array Destructuring shouldn't require use of $jscomp","user":{"login":"arciisine","id":1264175,"avatar_url":"https://avatars.githubusercontent.com/u/1264175?v=3","gravatar_id":"","url":"https://api.github.com/users/arciisine","html_url":"https://github.com/arciisine","followers_url":"https://api.github.com/users/arciisine/followers","following_url":"https://api.github.com/users/arciisine/following{/other_user}","gists_url":"https://api.github.com/users/arciisine/gists{/gist_id}","starred_url":"https://api.github.com/users/arciisine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arciisine/subscriptions","organizations_url":"https://api.github.com/users/arciisine/orgs","repos_url":"https://api.github.com/users/arciisine/repos","events_url":"https://api.github.com/users/arciisine/events{/privacy}","received_events_url":"https://api.github.com/users/arciisine/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-15T21:24:08Z","updated_at":"2016-09-15T21:37:35Z","closed_at":"2016-09-15T21:37:35Z","body":"When using a very simple destructuring pattern, it should be possible to convert this to simple assignments. Reading the spec, http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment, I can see why the definition of `$jscomp` is what it is, but it seems like overkill for simple assignments.  \r\n\r\nGiven the input:\r\n\r\n```javascript\r\n\r\nfunction add(a) {\r\n  let [b,c] = a;\r\n  return b+c;\r\n}\r\n\r\nadd([1,2])\r\n```\r\n\r\nI would expect the output to be something along the lines of:\r\n\r\n```javascript\r\nfunction test(a) {\r\n  var b = a[0], c = a[1];\r\n  return b+c;\r\n}\r\n\r\ntest([1,2])\r\n```\r\n\r\nInstead, what I'm seeing is:\r\n\r\n```javascript\r\n/* $jscomp definition */;\r\nfunction add(a){\r\n   var b=$jscomp.makeIterator(a);\r\n   a=b.next().value;\r\n   b=b.next().value;\r\n   return a+b\r\n}\r\nadd([1,2]);\r\n```"}}
{"actor":{"display_login":"brad4d"}}