{"action":"created","issue":{"url":"https://api.github.com/repos/terinjokes/gulp-uglify/issues/146","repository_url":"https://api.github.com/repos/terinjokes/gulp-uglify","labels_url":"https://api.github.com/repos/terinjokes/gulp-uglify/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/terinjokes/gulp-uglify/issues/146/comments","events_url":"https://api.github.com/repos/terinjokes/gulp-uglify/issues/146/events","html_url":"https://github.com/terinjokes/gulp-uglify/issues/146","id":115033543,"number":146,"title":"Issue with Babel, ES6 and Uglify","user":{"login":"lewiswalsh","id":1192147,"avatar_url":"https://avatars.githubusercontent.com/u/1192147?v=3","gravatar_id":"","url":"https://api.github.com/users/lewiswalsh","html_url":"https://github.com/lewiswalsh","followers_url":"https://api.github.com/users/lewiswalsh/followers","following_url":"https://api.github.com/users/lewiswalsh/following{/other_user}","gists_url":"https://api.github.com/users/lewiswalsh/gists{/gist_id}","starred_url":"https://api.github.com/users/lewiswalsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lewiswalsh/subscriptions","organizations_url":"https://api.github.com/users/lewiswalsh/orgs","repos_url":"https://api.github.com/users/lewiswalsh/repos","events_url":"https://api.github.com/users/lewiswalsh/events{/privacy}","received_events_url":"https://api.github.com/users/lewiswalsh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/terinjokes/gulp-uglify/labels/documentation","name":"documentation","color":"d105f0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-04T11:32:03Z","updated_at":"2016-06-06T13:16:40Z","closed_at":"2015-11-11T18:39:29Z","body":"Here is my gulp task:\r\n```javascript\r\ngulp.task('js', function(){\r\n    return gulp.src(paths.src.js)\r\n        .pipe(babel())\r\n        .pipe(uglify())\r\n        .pipe(gulp.dest(paths.dist.js));\r\n});\r\n```\r\n\r\nAnd here is the error I get if I use any ES6, even a simple `let` statement. If I stick with ES5 everything works fine:\r\n```\r\nevents.js:141\r\n      throw er; // Unhandled 'error' event\r\n      ^\r\nError\r\n    at new JS_Parse_Error (eval at <anonymous> (...\\node_modules\\gulp-uglify\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:1508:18)\r\n    at js_error (eval at <anonymous> (...\\node_modules\\gulp-uglify\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:1516:11)\r\n    at croak (eval at <anonymous> (...\\node_modules\\gulp-uglify\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:2008:9)\r\n    at token_error (eval at <anonymous> (...\\node_modules\\gulp-uglify\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:2016:9)\r\n    at unexpected (eval at <anonymous> (...\\node_modules\\gulp-uglify\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:2022:9)\r\n    at semicolon (eval at <anonymous> (...\\node_modules\\gulp-uglify\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:2042:43)\r\n    at simple_statement (eval at <anonymous> (...\\node_modules\\gulp-uglify\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:2222:73)\r\n    at eval (eval at <anonymous> (...\\node_modules\\gulp-uglify\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:2095:19)\r\n    at eval (eval at <anonymous> (...\\node_modules\\gulp-uglify\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:2055:24)\r\n    at block_ (eval at <anonymous> (...\\node_modules\\gulp-uglify\\node_modules\\uglify-js\\tools\\node.js:22:1), <anonymous>:2335:20)\r\n```\r\n\r\nA test js file that is failing:\r\n```javascript\r\n(function(window,document,undefined){\r\n    jQuery(document).ready(function($){\r\n        let test = 5;\r\n    });\r\n})(this, document);\r\n```\r\n\r\n**Update**\r\nTested on Windows 10 and Ubuntu 14.04 both with Node 4.1.2"},"comment":{"url":"https://api.github.com/repos/terinjokes/gulp-uglify/issues/comments/223955480","html_url":"https://github.com/terinjokes/gulp-uglify/issues/146#issuecomment-223955480","issue_url":"https://api.github.com/repos/terinjokes/gulp-uglify/issues/146","id":223955480,"user":{"login":"yuricamara","id":846066,"avatar_url":"https://avatars.githubusercontent.com/u/846066?v=3","gravatar_id":"","url":"https://api.github.com/users/yuricamara","html_url":"https://github.com/yuricamara","followers_url":"https://api.github.com/users/yuricamara/followers","following_url":"https://api.github.com/users/yuricamara/following{/other_user}","gists_url":"https://api.github.com/users/yuricamara/gists{/gist_id}","starred_url":"https://api.github.com/users/yuricamara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuricamara/subscriptions","organizations_url":"https://api.github.com/users/yuricamara/orgs","repos_url":"https://api.github.com/users/yuricamara/repos","events_url":"https://api.github.com/users/yuricamara/events{/privacy}","received_events_url":"https://api.github.com/users/yuricamara/received_events","type":"User","site_admin":false},"created_at":"2016-06-06T13:16:40Z","updated_at":"2016-06-06T13:16:40Z","body":"Nice @HyperBrain . It worked with uglify-js-harmony! Thank you very much!"}}
{"actor":{"display_login":"yuricamara"}}