{"action":"created","issue":{"url":"https://api.github.com/repos/oklai/koala/issues/645","repository_url":"https://api.github.com/repos/oklai/koala","labels_url":"https://api.github.com/repos/oklai/koala/issues/645/labels{/name}","comments_url":"https://api.github.com/repos/oklai/koala/issues/645/comments","events_url":"https://api.github.com/repos/oklai/koala/issues/645/events","html_url":"https://github.com/oklai/koala/issues/645","id":232019283,"number":645,"title":"js file minify fail on Harmony(ES6+) option checked","user":{"login":"jeffy-g","id":26692481,"avatar_url":"https://avatars0.githubusercontent.com/u/26692481?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffy-g","html_url":"https://github.com/jeffy-g","followers_url":"https://api.github.com/users/jeffy-g/followers","following_url":"https://api.github.com/users/jeffy-g/following{/other_user}","gists_url":"https://api.github.com/users/jeffy-g/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffy-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffy-g/subscriptions","organizations_url":"https://api.github.com/users/jeffy-g/orgs","repos_url":"https://api.github.com/users/jeffy-g/repos","events_url":"https://api.github.com/users/jeffy-g/events{/privacy}","received_events_url":"https://api.github.com/users/jeffy-g/received_events","type":"User","site_admin":false},"labels":[{"id":23136585,"url":"https://api.github.com/repos/oklai/koala/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-29T13:10:40Z","updated_at":"2017-05-31T14:20:16Z","closed_at":null,"body":"## Koala version\r\nv2.2.0\r\n## Bug report or feature request?\r\nBug report\r\n\r\n## summary:\r\njs file minify fail on Harmony(ES6+) option checked. (uglify-js@3.0.4\r\n\r\ntsc: compile with target \"es6\"\r\n\r\n`ts file`\r\n```ts\r\ndeclare interface IDummy {\r\n    file(): void;\r\n}\r\n\r\nnamespace lengthbug {\r\n    export function createMessageFileX(): IDummy {\r\n        return new MessageFileX();\r\n    }\r\n    /*export*/ class MessageFileX implements IDummy {\r\n        private _messages: Array<JQuery> = [];\r\n        public constructor() {}\r\n        public file(): void {\r\n            if (this._messages.length > 10) {\r\n                console.log(\"out of bound!\");\r\n            }\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n`js file`\r\n```js\r\nvar lengthbug;\r\n(function (lengthbug) {\r\n    function createMessageFileX() {\r\n        return new MessageFileX();\r\n    }\r\n    lengthbug.createMessageFileX = createMessageFileX;\r\n    class MessageFileX {\r\n        constructor() {\r\n            this._messages = [];\r\n        }\r\n        file() {\r\n            if (this._messages.length > 10) {\r\n                              //^^^^^\r\n                console.log(\"out of bound!\");\r\n            }\r\n        }\r\n    }\r\n})(lengthbug || (lengthbug = {}));\r\n\r\n```\r\nerror message appeared.\r\nthat message is:\r\n\r\n`\"Cannot read property 'length' of undefined\"`\r\n...\r\n\r\n![k193iy6](https://cloud.githubusercontent.com/assets/26692481/26550957/30655892-44bb-11e7-82ee-57b3dfffe85f.png)\r\n\r\nthis is sample source.\r\nwell, these are uglify-js bug...\r\n\r\nhowever, this is **no error**.\r\n```js\r\nvar lengthbug;\r\n(function (lengthbug) {\r\n    function createMessageFileX() {\r\n        return new MessageFileX();\r\n    }\r\n    lengthbug.createMessageFileX = createMessageFileX;\r\n    class MessageFileX {\r\n        constructor() {\r\n            this._messages = [];\r\n        }\r\n        file() {\r\n            if (this._messages.length > 10) {\r\n                console.log(\"out of bound!\");\r\n            }\r\n        }\r\n    }\r\n    lengthbug.MessageFileX = MessageFileX; // <-- \r\n})(lengthbug || (lengthbug = {}));\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/oklai/koala/issues/comments/305201463","html_url":"https://github.com/oklai/koala/issues/645#issuecomment-305201463","issue_url":"https://api.github.com/repos/oklai/koala/issues/645","id":305201463,"user":{"login":"jeffy-g","id":26692481,"avatar_url":"https://avatars0.githubusercontent.com/u/26692481?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffy-g","html_url":"https://github.com/jeffy-g","followers_url":"https://api.github.com/users/jeffy-g/followers","following_url":"https://api.github.com/users/jeffy-g/following{/other_user}","gists_url":"https://api.github.com/users/jeffy-g/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffy-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffy-g/subscriptions","organizations_url":"https://api.github.com/users/jeffy-g/orgs","repos_url":"https://api.github.com/users/jeffy-g/repos","events_url":"https://api.github.com/users/jeffy-g/events{/privacy}","received_events_url":"https://api.github.com/users/jeffy-g/received_events","type":"User","site_admin":false},"created_at":"2017-05-31T14:20:16Z","updated_at":"2017-05-31T14:20:16Z","body":"i hope your improvement :-)\r\n\r\nthanks :+1: "}}
{"actor":{"display_login":"jeffy-g"}}