{"action":"created","issue":{"url":"https://api.github.com/repos/mulesoft/api-console/issues/169","labels_url":"https://api.github.com/repos/mulesoft/api-console/issues/169/labels{/name}","comments_url":"https://api.github.com/repos/mulesoft/api-console/issues/169/comments","events_url":"https://api.github.com/repos/mulesoft/api-console/issues/169/events","html_url":"https://github.com/mulesoft/api-console/issues/169","id":102895488,"number":169,"title":"api-console.js and api-console-vendor.js cannot be minified using YUICompressor due to usage of reserved keywords","user":{"login":"ravikiranj","id":389491,"avatar_url":"https://avatars.githubusercontent.com/u/389491?v=3","gravatar_id":"","url":"https://api.github.com/users/ravikiranj","html_url":"https://github.com/ravikiranj","followers_url":"https://api.github.com/users/ravikiranj/followers","following_url":"https://api.github.com/users/ravikiranj/following{/other_user}","gists_url":"https://api.github.com/users/ravikiranj/gists{/gist_id}","starred_url":"https://api.github.com/users/ravikiranj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ravikiranj/subscriptions","organizations_url":"https://api.github.com/users/ravikiranj/orgs","repos_url":"https://api.github.com/users/ravikiranj/repos","events_url":"https://api.github.com/users/ravikiranj/events{/privacy}","received_events_url":"https://api.github.com/users/ravikiranj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-24T21:29:06Z","updated_at":"2015-08-24T22:28:27Z","closed_at":null,"body":"The generated api-console.js and api-console-vendor.js use 'enum', 'for', 'boolean', 'default'. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar for list of reserved keywords.\r\n```\r\n$ java -jar yuicompressor-2.4.8.jar -v --type js api-console.js -o minified.js\r\n 1:0:Compilation produced 123 syntax errors.\r\norg.mozilla.javascript.EvaluatorException: Compilation produced 123 syntax errors.\r\n\r\n$ java -jar yuicompressor-2.4.8.jar -v --type js api-console-vendor.js -o minified.js \r\n[ERROR] in api-console-vendor.js\r\n  1:0:Compilation produced 408 syntax errors.\r\norg.mozilla.javascript.EvaluatorException: Compilation produced 408 syntax errors.\r\n```\r\n\r\nThe correct way to refer the reserved keywords would be to wrap them in quotes such as ```obj[\"enum\"]``` instead of ```obj.enum```"},"comment":{"url":"https://api.github.com/repos/mulesoft/api-console/issues/comments/134399808","html_url":"https://github.com/mulesoft/api-console/issues/169#issuecomment-134399808","issue_url":"https://api.github.com/repos/mulesoft/api-console/issues/169","id":134399808,"user":{"login":"blakeembrey","id":1088987,"avatar_url":"https://avatars.githubusercontent.com/u/1088987?v=3","gravatar_id":"","url":"https://api.github.com/users/blakeembrey","html_url":"https://github.com/blakeembrey","followers_url":"https://api.github.com/users/blakeembrey/followers","following_url":"https://api.github.com/users/blakeembrey/following{/other_user}","gists_url":"https://api.github.com/users/blakeembrey/gists{/gist_id}","starred_url":"https://api.github.com/users/blakeembrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blakeembrey/subscriptions","organizations_url":"https://api.github.com/users/blakeembrey/orgs","repos_url":"https://api.github.com/users/blakeembrey/repos","events_url":"https://api.github.com/users/blakeembrey/events{/privacy}","received_events_url":"https://api.github.com/users/blakeembrey/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T22:28:26Z","updated_at":"2015-08-24T22:28:26Z","body":"The variable names won't be broken otherwise this would have already been an issue, as noted above. Is there no option for `yiucompressor` to support ES5 or is it literally using Rhino to parse?\r\n\r\nWe can accept a PR if it works for you. I'd start by looking at either disabling ES5 in our linting or using something like https://github.com/spicyj/es3ify so this doesn't happen again. However, you might end up running into more issues with any dependencies that aren't written using ES3 too (not sure how likely, ES5 has been around for a while). The alternative is to use a compressor that works for ES5, which should be pretty all of them. If you're using Java, you could try using https://github.com/google/closure-compiler which appears to work fine with ES5.\r\n\r\nMy knowledge of Rhino about ends there, so you might have to investigate what the issue with the compiler is if you want to use `yuicompressor` (relevant issues https://github.com/yui/yuicompressor/issues/183, https://github.com/yui/yuicompressor/issues/47, many others, and https://github.com/yui/yuicompressor/issues/41#issuecomment-13721460 which was a couple of years ago stating it'd be fixed)."}}