{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8856","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8856/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8856/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8856/events","html_url":"https://github.com/Microsoft/TypeScript/issues/8856","id":157219836,"number":8856,"title":"Spread operator is not correctly translated into JS","user":{"login":"tnikodym","id":19610642,"avatar_url":"https://avatars.githubusercontent.com/u/19610642?v=3","gravatar_id":"","url":"https://api.github.com/users/tnikodym","html_url":"https://github.com/tnikodym","followers_url":"https://api.github.com/users/tnikodym/followers","following_url":"https://api.github.com/users/tnikodym/following{/other_user}","gists_url":"https://api.github.com/users/tnikodym/gists{/gist_id}","starred_url":"https://api.github.com/users/tnikodym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tnikodym/subscriptions","organizations_url":"https://api.github.com/users/tnikodym/orgs","repos_url":"https://api.github.com/users/tnikodym/repos","events_url":"https://api.github.com/users/tnikodym/events{/privacy}","received_events_url":"https://api.github.com/users/tnikodym/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/ES6","name":"ES6","color":"c7def8"}],"state":"open","locked":false,"assignee":{"login":"yuit","id":489742,"avatar_url":"https://avatars.githubusercontent.com/u/489742?v=3","gravatar_id":"","url":"https://api.github.com/users/yuit","html_url":"https://github.com/yuit","followers_url":"https://api.github.com/users/yuit/followers","following_url":"https://api.github.com/users/yuit/following{/other_user}","gists_url":"https://api.github.com/users/yuit/gists{/gist_id}","starred_url":"https://api.github.com/users/yuit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuit/subscriptions","organizations_url":"https://api.github.com/users/yuit/orgs","repos_url":"https://api.github.com/users/yuit/repos","events_url":"https://api.github.com/users/yuit/events{/privacy}","received_events_url":"https://api.github.com/users/yuit/received_events","type":"User","site_admin":false},"assignees":[{"login":"yuit","id":489742,"avatar_url":"https://avatars.githubusercontent.com/u/489742?v=3","gravatar_id":"","url":"https://api.github.com/users/yuit","html_url":"https://github.com/yuit","followers_url":"https://api.github.com/users/yuit/followers","following_url":"https://api.github.com/users/yuit/following{/other_user}","gists_url":"https://api.github.com/users/yuit/gists{/gist_id}","starred_url":"https://api.github.com/users/yuit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuit/subscriptions","organizations_url":"https://api.github.com/users/yuit/orgs","repos_url":"https://api.github.com/users/yuit/repos","events_url":"https://api.github.com/users/yuit/events{/privacy}","received_events_url":"https://api.github.com/users/yuit/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/20","html_url":"https://github.com/Microsoft/TypeScript/milestones/TypeScript%202.1","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/20/labels","id":1601840,"number":20,"title":"TypeScript 2.1","description":"","creator":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"open_issues":203,"closed_issues":39,"state":"open","created_at":"2016-02-24T06:32:42Z","updated_at":"2016-09-06T20:22:41Z","due_on":null,"closed_at":null},"comments":14,"created_at":"2016-05-27T14:32:09Z","updated_at":"2016-09-06T21:47:06Z","closed_at":null,"body":"\r\n\r\n**TypeScript Version:**  1.8 \r\n**Target:** ES5\r\n\r\nThe following code: \r\n\r\n```ts\r\n[...(new Array(5))]\r\n```\r\ntranslates into: \r\n\r\n```ts\r\n(new Array(5)).slice();\r\n```\r\nHowever, the ES6 meaning is not the same. See the output below: \r\n\r\n```ts\r\n> [...(new Array(5))]\r\n[ undefined, undefined, undefined, undefined, undefined ]\r\n> (new Array(5)).slice();\r\n[ , , , ,  ]\r\n```\r\n\r\nExpected behavior: \r\n```ts\r\nArray.apply(null, Array(5))\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/245106465","html_url":"https://github.com/Microsoft/TypeScript/issues/8856#issuecomment-245106465","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8856","id":245106465,"user":{"login":"LPGhatguy","id":654598,"avatar_url":"https://avatars.githubusercontent.com/u/654598?v=3","gravatar_id":"","url":"https://api.github.com/users/LPGhatguy","html_url":"https://github.com/LPGhatguy","followers_url":"https://api.github.com/users/LPGhatguy/followers","following_url":"https://api.github.com/users/LPGhatguy/following{/other_user}","gists_url":"https://api.github.com/users/LPGhatguy/gists{/gist_id}","starred_url":"https://api.github.com/users/LPGhatguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LPGhatguy/subscriptions","organizations_url":"https://api.github.com/users/LPGhatguy/orgs","repos_url":"https://api.github.com/users/LPGhatguy/repos","events_url":"https://api.github.com/users/LPGhatguy/events{/privacy}","received_events_url":"https://api.github.com/users/LPGhatguy/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T21:47:06Z","updated_at":"2016-09-06T21:47:06Z","body":"I ran into this issue today writing some JSX using the spread operator; the way that TS handles the simplest spread case is strange!\r\n\r\nHere's a specific StackOverflow answer recommending `[...Array(N)]` syntax for repeating an element N times: http://stackoverflow.com/a/29629588"}}
{"actor":{"display_login":"LPGhatguy"}}