{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/5677","repository_url":"https://api.github.com/repos/Microsoft/ChakraCore","labels_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/5677/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/5677/comments","events_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/5677/events","html_url":"https://github.com/Microsoft/ChakraCore/issues/5677","id":358436710,"node_id":"MDU6SXNzdWUzNTg0MzY3MTA=","number":5677,"title":"TypeError shouldn't be thrown when function's argument is an empty array using spread operator","user":{"login":"sunlili","id":10752186,"node_id":"MDQ6VXNlcjEwNzUyMTg2","avatar_url":"https://avatars1.githubusercontent.com/u/10752186?v=4","gravatar_id":"","url":"https://api.github.com/users/sunlili","html_url":"https://github.com/sunlili","followers_url":"https://api.github.com/users/sunlili/followers","following_url":"https://api.github.com/users/sunlili/following{/other_user}","gists_url":"https://api.github.com/users/sunlili/gists{/gist_id}","starred_url":"https://api.github.com/users/sunlili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunlili/subscriptions","organizations_url":"https://api.github.com/users/sunlili/orgs","repos_url":"https://api.github.com/users/sunlili/repos","events_url":"https://api.github.com/users/sunlili/events{/privacy}","received_events_url":"https://api.github.com/users/sunlili/received_events","type":"User","site_admin":false},"labels":[{"id":307793022,"node_id":"MDU6TGFiZWwzMDc3OTMwMjI=","url":"https://api.github.com/repos/Microsoft/ChakraCore/labels/Bug","name":"Bug","color":"dd2020","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/milestones/8","html_url":"https://github.com/Microsoft/ChakraCore/milestone/8","labels_url":"https://api.github.com/repos/Microsoft/ChakraCore/milestones/8/labels","id":2206099,"node_id":"MDk6TWlsZXN0b25lMjIwNjA5OQ==","number":8,"title":"vNext","description":"Issues targeted for the next release of ChakraCore.","creator":{"login":"dilijev","id":494055,"node_id":"MDQ6VXNlcjQ5NDA1NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/494055?v=4","gravatar_id":"","url":"https://api.github.com/users/dilijev","html_url":"https://github.com/dilijev","followers_url":"https://api.github.com/users/dilijev/followers","following_url":"https://api.github.com/users/dilijev/following{/other_user}","gists_url":"https://api.github.com/users/dilijev/gists{/gist_id}","starred_url":"https://api.github.com/users/dilijev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dilijev/subscriptions","organizations_url":"https://api.github.com/users/dilijev/orgs","repos_url":"https://api.github.com/users/dilijev/repos","events_url":"https://api.github.com/users/dilijev/events{/privacy}","received_events_url":"https://api.github.com/users/dilijev/received_events","type":"User","site_admin":false},"open_issues":123,"closed_issues":118,"state":"open","created_at":"2016-12-19T23:56:06Z","updated_at":"2018-09-10T17:40:27Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-09-10T01:37:18Z","updated_at":"2018-09-11T03:05:38Z","closed_at":null,"author_association":"NONE","body":"Hi, executing following code, ChakraCore will throw a TypeError. It seems that ch treats the empty array as undefined or null.\r\n```\r\nfunction f(...[]) {return 23};\r\nf();\r\nprint(\"BT_FLAG\");\r\n```\r\nThe output of ChakraCore:\r\n`TypeError: Unable to get property 'Symbol.iterator' of undefined or null reference`\r\n\r\nHowever, the output should be:\r\n`BT_FLAG`\r\n\r\nBT group\r\n2018.09.10"},"comment":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/comments/420131200","html_url":"https://github.com/Microsoft/ChakraCore/issues/5677#issuecomment-420131200","issue_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/5677","id":420131200,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDEzMTIwMA==","user":{"login":"fatcerberus","id":4097841,"node_id":"MDQ6VXNlcjQwOTc4NDE=","avatar_url":"https://avatars2.githubusercontent.com/u/4097841?v=4","gravatar_id":"","url":"https://api.github.com/users/fatcerberus","html_url":"https://github.com/fatcerberus","followers_url":"https://api.github.com/users/fatcerberus/followers","following_url":"https://api.github.com/users/fatcerberus/following{/other_user}","gists_url":"https://api.github.com/users/fatcerberus/gists{/gist_id}","starred_url":"https://api.github.com/users/fatcerberus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatcerberus/subscriptions","organizations_url":"https://api.github.com/users/fatcerberus/orgs","repos_url":"https://api.github.com/users/fatcerberus/repos","events_url":"https://api.github.com/users/fatcerberus/events{/privacy}","received_events_url":"https://api.github.com/users/fatcerberus/received_events","type":"User","site_admin":false},"created_at":"2018-09-11T03:05:38Z","updated_at":"2018-09-11T03:05:38Z","author_association":"CONTRIBUTOR","body":"I actually didn't even realize `function f(...[]) {return 23}` was legal syntax.  Huh.\r\n\r\n@akroshg Interestingly, your second case actually throws in Node 10.9:\r\n```\r\n> function f([]) {return 23};\r\nundefined\r\n> f()\r\nTypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined\r\n    at f (repl:1:11)\r\n> process.version\r\n'v10.9.0'\r\n```"}}
{"actor":{"display_login":"fatcerberus"}}