{"action":"created","issue":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/1460","repository_url":"https://api.github.com/repos/mishoo/UglifyJS2","labels_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/1460/labels{/name}","comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/1460/comments","events_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/1460/events","html_url":"https://github.com/mishoo/UglifyJS2/pull/1460","id":204949388,"number":1460,"title":"[WIP][3.x] convert AST_Seq from binary tree to array","user":{"login":"alexlamsl","id":1898413,"avatar_url":"https://avatars.githubusercontent.com/u/1898413?v=3","gravatar_id":"","url":"https://api.github.com/users/alexlamsl","html_url":"https://github.com/alexlamsl","followers_url":"https://api.github.com/users/alexlamsl/followers","following_url":"https://api.github.com/users/alexlamsl/following{/other_user}","gists_url":"https://api.github.com/users/alexlamsl/gists{/gist_id}","starred_url":"https://api.github.com/users/alexlamsl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexlamsl/subscriptions","organizations_url":"https://api.github.com/users/alexlamsl/orgs","repos_url":"https://api.github.com/users/alexlamsl/repos","events_url":"https://api.github.com/users/alexlamsl/events{/privacy}","received_events_url":"https://api.github.com/users/alexlamsl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":40,"created_at":"2017-02-02T17:56:28Z","updated_at":"2017-02-03T18:29:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/pulls/1460","html_url":"https://github.com/mishoo/UglifyJS2/pull/1460","diff_url":"https://github.com/mishoo/UglifyJS2/pull/1460.diff","patch_url":"https://github.com/mishoo/UglifyJS2/pull/1460.patch"},"body":"/cc @kzc @rvanvelzen"},"comment":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/comments/277324360","html_url":"https://github.com/mishoo/UglifyJS2/pull/1460#issuecomment-277324360","issue_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/1460","id":277324360,"user":{"login":"alexlamsl","id":1898413,"avatar_url":"https://avatars.githubusercontent.com/u/1898413?v=3","gravatar_id":"","url":"https://api.github.com/users/alexlamsl","html_url":"https://github.com/alexlamsl","followers_url":"https://api.github.com/users/alexlamsl/followers","following_url":"https://api.github.com/users/alexlamsl/following{/other_user}","gists_url":"https://api.github.com/users/alexlamsl/gists{/gist_id}","starred_url":"https://api.github.com/users/alexlamsl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexlamsl/subscriptions","organizations_url":"https://api.github.com/users/alexlamsl/orgs","repos_url":"https://api.github.com/users/alexlamsl/repos","events_url":"https://api.github.com/users/alexlamsl/events{/privacy}","received_events_url":"https://api.github.com/users/alexlamsl/received_events","type":"User","site_admin":false},"created_at":"2017-02-03T18:29:47Z","updated_at":"2017-02-03T18:29:47Z","body":"Just a quick overview on what's changed as mentioned in https://github.com/mishoo/UglifyJS2/pull/1460#issuecomment-277314160\r\n\r\n### master, `OPT(AST_Seq)`\r\n- scans from right to left, one pair of expressions at a time\r\n- `side_effects` 🆗\r\n- if any of the following rule hits, return transformed expression\r\n  1. `42, b` ➡️ `b` (or `42, b()` ➡️ `0, b()`)\r\n  2. (`cascade` 🆗) `b = c, b` ➡️ `b = c`\r\n  3. (`cascade` 🆗) `b = c, b()` ➡️ `(b = c)()`\r\n  4. (`cascade` 🆗) `42, 42` ➡️ `42` (I believe this is covered by Rule No. 1 already)\r\n  5. `a, void 42` ➡️ `void a`\r\n  6. `a, undefined` ➡️ `void a`\r\n- if none of the rules hit, return original `AST_Seq`\r\n\r\n### This PR, `OPT(AST_Sequence)`\r\n- process the whole array of expressions in one go\r\n- `side_effects` 🆗\r\n- `1, a, 2, c, 3` ➡️ `a, c, 3`\r\n- if still have multiple elements left, either _one or none_ of the following:\r\n  1. `a, void 1, b, void 2, undefined` ➡️ `a, void 1, void b`\r\n  2. (`cascade` 🆗) `b = c, b` ➡️ `b = c`\r\n  3. (`cascade` 🆗) `b = c, b()` ➡️ `(b = c)()`\r\n- if none of the rules hit, return original `AST_Sequence`\r\n- if single element, output that\r\n- output new `AST_Sequence` of elements"}}
{"actor":{"display_login":"alexlamsl"}}