{"action":"created","issue":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/588","labels_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/588/labels{/name}","comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/588/comments","events_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/588/events","html_url":"https://github.com/mishoo/UglifyJS2/issues/588","id":51502012,"number":588,"title":"TypeError","user":{"login":"andrewpmartinez","id":199856,"avatar_url":"https://avatars.githubusercontent.com/u/199856?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewpmartinez","html_url":"https://github.com/andrewpmartinez","followers_url":"https://api.github.com/users/andrewpmartinez/followers","following_url":"https://api.github.com/users/andrewpmartinez/following{/other_user}","gists_url":"https://api.github.com/users/andrewpmartinez/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewpmartinez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewpmartinez/subscriptions","organizations_url":"https://api.github.com/users/andrewpmartinez/orgs","repos_url":"https://api.github.com/users/andrewpmartinez/repos","events_url":"https://api.github.com/users/andrewpmartinez/events{/privacy}","received_events_url":"https://api.github.com/users/andrewpmartinez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-12-10T00:23:32Z","updated_at":"2015-01-04T10:55:29Z","closed_at":null,"body":"Not sure what is going on. My uglification step keeps throwing errors.\r\n\r\n````\r\nMinifying with UglifyJS...Reading .tmp/concat/app/app.js...OK\r\n[TypeError: Cannot call method 'toString' of undefined]\r\n>> Uglifying source .tmp/concat/app/app.js failed.\r\nWarning: Uglification failed.\r\nCannot call method 'toString' of undefined.\r\n Use --force to continue.\r\nTypeError: Cannot call method 'toString' of undefined\r\n    at i (C:source\\best-app-ever-web\\best-app-ever\\node_modules\\grunt-contrib-uglify\\node_modules\\uglify-js\\lib\\output.js:1159:35)\r\n    at doit (C:source\\best-app-ever-web\\best-app-ever\\node_modules\\grunt-contrib-uglify\\node_modules\\uglify-js\\lib\\output.js:362:13)\r\n    at AST_Node.print (C:source\\best-app-ever-web\\best-app-ever\\node_modules\\grunt-contrib-uglify\\node_modules\\uglify-js\\lib\\output.js:368:13)\r\n    at AST_Node.print_to_string (C:source\\best-app-ever-web\\best-app-ever\\node_modules\\grunt-contrib-uglify\\node_modules\\uglify-js\\lib\\output.js:375:14)\r\n    at best_of (C:source\\best-app-ever-web\\best-app-ever\\node_modules\\grunt-contrib-uglify\\node_modules\\uglify-js\\lib\\compress.js:668:21)\r\n    at AST_Node.e [as evaluate] (C:source\\best-app-ever-web\\best-app-ever\\node_modules\\grunt-contrib-uglify\\node_modules\\uglify-js\\lib\\compress.js:686:26)\r\n    at C:source\\best-app-ever-web\\best-app-ever\\node_modules\\grunt-contrib-uglify\\node_modules\\uglify-js\\lib\\compress.js:2193:21\r\n    at AST_Node.optimize (C:source\\best-app-ever-web\\best-app-ever\\node_modules\\grunt-contrib-uglify\\node_modules\\uglify-js\\lib\\compress.js:113:23)\r\n    at Object.merge.before (C:source\\best-app-ever-web\\best-app-ever\\node_modules\\grunt-contrib-uglify\\node_modules\\uglify-js\\lib\\compress.js:97:21)\r\n    at AST_Node.transform (C:source\\best-app-ever-web\\best-app-ever\\node_modules\\grunt-contrib-uglify\\node_modules\\uglify-js\\lib\\transform.js:61:35)\r\n    at C:source\\best-app-ever-web\\best-app-ever\\node_modules\\grunt-contrib-uglify\\node_modules\\uglify-js\\lib\\transform.js:196:31\r\n````\r\n\r\nI am using generator-angular-fullstack to scaffold an application. At some point during development the production build (which uglifies) started failing. I have no idea what changed or why.\r\n\r\nI have tried turning ascii only mod. Using grunt-contrib-uglify 4.0, 4.1, 5.0, and 6.0 (which have various versions of Uglify-Js).\r\n\r\nAny ideas on what I can look for? Another file in my project runs just before this one and works fine.\r\n\r\nFWIW line 1159 in the first looks like this (specifically self.getValue().toString(); ):\r\n\r\n````\r\n    DEFPRINT(AST_RegExp, function(self, output){\r\n        var str = self.getValue().toString();\r\n        if (output.option(\"ascii_only\")) {\r\n            str = output.to_ascii(str);\r\n        } else if (output.option(\"unescape_regexps\")) {\r\n            str = str.split(\"\\\\\\\\\").map(function(str){\r\n                return str.replace(/\\\\u[0-9a-fA-F]{4}|\\\\x[0-9a-fA-F]{2}/g, function(s){\r\n                    var code = parseInt(s.substr(2), 16);\r\n                    return regexp_safe_literal(code) ? String.fromCharCode(code) : s;\r\n                });\r\n            }).join(\"\\\\\\\\\");\r\n        }\r\n        output.print(str);\r\n        var p = output.parent();\r\n        if (p instanceof AST_Binary && /^in/.test(p.operator) && p.left === self)\r\n            output.print(\" \");\r\n    });\r\n````"},"comment":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/comments/68628792","html_url":"https://github.com/mishoo/UglifyJS2/issues/588#issuecomment-68628792","issue_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/588","id":68628792,"user":{"login":"rvanvelzen","id":102603,"avatar_url":"https://avatars.githubusercontent.com/u/102603?v=3","gravatar_id":"","url":"https://api.github.com/users/rvanvelzen","html_url":"https://github.com/rvanvelzen","followers_url":"https://api.github.com/users/rvanvelzen/followers","following_url":"https://api.github.com/users/rvanvelzen/following{/other_user}","gists_url":"https://api.github.com/users/rvanvelzen/gists{/gist_id}","starred_url":"https://api.github.com/users/rvanvelzen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvanvelzen/subscriptions","organizations_url":"https://api.github.com/users/rvanvelzen/orgs","repos_url":"https://api.github.com/users/rvanvelzen/repos","events_url":"https://api.github.com/users/rvanvelzen/events{/privacy}","received_events_url":"https://api.github.com/users/rvanvelzen/received_events","type":"User","site_admin":false},"created_at":"2015-01-04T10:55:29Z","updated_at":"2015-01-04T10:55:29Z","body":"Could you provide us with an example with which this issue can be reproduced?"}}