{"action":"closed","issue":{"url":"https://api.github.com/repos/rollup/rollup-plugin-babel/issues/59","repository_url":"https://api.github.com/repos/rollup/rollup-plugin-babel","labels_url":"https://api.github.com/repos/rollup/rollup-plugin-babel/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/rollup/rollup-plugin-babel/issues/59/comments","events_url":"https://api.github.com/repos/rollup/rollup-plugin-babel/issues/59/events","html_url":"https://github.com/rollup/rollup-plugin-babel/issues/59","id":159362345,"number":59,"title":"2.5.0 breaks anything that uses typeof","user":{"login":"chriso","id":364903,"avatar_url":"https://avatars.githubusercontent.com/u/364903?v=3","gravatar_id":"","url":"https://api.github.com/users/chriso","html_url":"https://github.com/chriso","followers_url":"https://api.github.com/users/chriso/followers","following_url":"https://api.github.com/users/chriso/following{/other_user}","gists_url":"https://api.github.com/users/chriso/gists{/gist_id}","starred_url":"https://api.github.com/users/chriso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriso/subscriptions","organizations_url":"https://api.github.com/users/chriso/orgs","repos_url":"https://api.github.com/users/chriso/repos","events_url":"https://api.github.com/users/chriso/events{/privacy}","received_events_url":"https://api.github.com/users/chriso/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-06-09T09:18:31Z","updated_at":"2016-06-09T19:46:25Z","closed_at":"2016-06-09T19:46:25Z","body":"I see the following changes in my code when going from 2.4.0 to 2.5.0:\r\n\r\n```javascript\r\n      var typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\r\n        return typeof obj;\r\n      } : function (obj) {\r\n        return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\r\n      };\r\n```\r\n\r\nPreviously it was this:\r\n\r\n```javascript\r\n      var babelHelpers = {};\r\n      babelHelpers.typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\r\n        return typeof obj;\r\n      } : function (obj) {\r\n        return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\r\n      };\r\n      babelHelpers;\r\n```\r\n\r\nMinifying the first chunk of code with uglify-js fails with an error, since `typeof` is a keyword:\r\n\r\n```javascript\r\n$ echo 'var typeof = 1' | ./node_modules/.bin/uglifyjs\r\nParse error at -:1,4\r\nName expected\r\nError\r\n    at new JS_Parse_Error (eval at <anonymous> (/Users/chris/Documents/validator.js/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:1526:18)\r\n    at js_error (eval at <anonymous> (/Users/chris/Documents/validator.js/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:1534:11)\r\n    at croak (eval at <anonymous> (/Users/chris/Documents/validator.js/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2026:9)\r\n    at as_symbol (eval at <anonymous> (/Users/chris/Documents/validator.js/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2664:27)\r\n    at vardefs (eval at <anonymous> (/Users/chris/Documents/validator.js/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2432:25)\r\n    at var_ (eval at <anonymous> (/Users/chris/Documents/validator.js/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2446:27)\r\n    at eval (eval at <anonymous> (/Users/chris/Documents/validator.js/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2194:30)\r\n    at eval (eval at <anonymous> (/Users/chris/Documents/validator.js/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2073:24)\r\n    at eval (eval at <anonymous> (/Users/chris/Documents/validator.js/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2827:23)\r\n    at Object.parse (eval at <anonymous> (/Users/chris/Documents/validator.js/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2837:7)\r\n```\r\n\r\nNode rejects it too:\r\n\r\n```\r\n$ echo 'var typeof = 1;' > typeof.js\r\n$ node typeof.js \r\n/Users/chris/Documents/validator.js/typeof.js:1\r\n(function (exports, require, module, __filename, __dirname) { var typeof = 1\r\n                                                                  ^^^^^^\r\nSyntaxError: Unexpected token typeof\r\n    at exports.runInThisContext (vm.js:73:16)\r\n    at Module._compile (module.js:443:25)\r\n    at Object.Module._extensions..js (module.js:478:10)\r\n    at Module.load (module.js:355:32)\r\n    at Function.Module._load (module.js:310:12)\r\n    at Function.Module.runMain (module.js:501:10)\r\n    at startup (node.js:129:16)\r\n    at node.js:814:3\r\n```"}}
{"actor":{"display_login":"chriso"}}