-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Harmony 2.8.0 #1509
Harmony 2.8.0 #1509
Conversation
…that it is not a reserved word. This should apply to propsmangle as well.
…fiers verify that property names after mangle are legal
remove extraneous call to AST_SymbolRef.reference() closes mishoo#1443
they are computed but never used closes mishoo#1444
happens when inner function: - just below top level - not referenced - `unused` is disabled closes mishoo#1445
move out of unsafe, guard corner case with screw_id8 instead closes mishoo#1446
- assign statement does not count towards variable usage by default - only works with assignments on the same scope level as declaration - can be disabled with `unused` set to "keep_assign" - `toplevel` to drop unused top-level variables and/or functions - `top_retain` to whitelist top-level exceptions closes mishoo#1450
fixes - [a].join() => "" + a - ["a", , "b"].join() => "a,,b" - ["a", null, "b"].join() => "a,,b" - ["a", undefined, "b"].join() => "a,,b" improvements - ["a", "b"].join(null) => "anullb" - ["a", "b"].join(undefined) => "a,b" - [a + "b", c].join("") => a + "b" + c closes mishoo#1453
- `do{...}while(false)` => `{...}` - clean up `AST_While` logic closes mishoo#1452
N = 2: a; b; c; d; was: a, b; c; d; now: a, b; c, d; fixes mishoo#1455 closes mishoo#1457
shuffle associative operations to minimise parentheses and aid other uglification efforts closes mishoo#1454
- remove extra tree scanning phase for `negate_iife` - `negate_iife` now only deals with the narrowest form, i.e. IIFE sitting directly under `AST_SimpleStatement` - `booleans`, `conditionals` etc. will now take care the rest via more accurate accounting - `a(); void b();` => `a(); b();` fixes mishoo#1288 closes mishoo#1451
previously test cases with the same name would be skipped except for the last one `test/run-test.js` will now report duplicated names as errors closes mishoo#1461
- utilise in_use_ids instead of unreferenced() - drop_unused now up-to-date for subsequent passes closes mishoo#1476
- update modified flag between compress() passes - support IIFE arguments - fix corner case with multiple definitions closes mishoo#1473
fix invalid boolean conversion now exposed in `make_node_from_constant()` closes mishoo#1477
- support arrays, objects & AST_Node - support `"a.b":1` on both cli & API - emit warning if variable is modified - override top-level variables fixes mishoo#1416 closes mishoo#1198 closes mishoo#1469
- `test/benchmark.js` measures performance - `test/jetstream.js` verifies correctness - configurable mangle/compress/output options closes mishoo#1479
reduce whitespaces from if-else statements fixes mishoo#1482 closes mishoo#1483
- `Array.prototype.slice` => `[].slice` closes mishoo#1491
- never exceed specified limit - otherwise warning is shown - enabled only for final output closes mishoo#1496
- only drops side-effect-free arguments - drop side-effect-free parts with discarded value from `AST_Seq` & `AST_SimpleStatement` closes mishoo#1494
A function call or IIFE with an immediately preceding comment containing `@__PURE__` or `#__PURE__` is deemed to be a side-effect-free pure function call and can potentially be dropped. Depends on `side_effects` option. `[#@]__PURE__` hint will be removed from comment when pure call is dropped. fixes mishoo#1261 closes mishoo#1448
- fix corner cases in `const` optimisation - deprecate `/*@const*/` fixes mishoo#1497 closes mishoo#1498
master:
#1509 including patch:
Ideas? |
The real question is why didn't master also report the false positive? |
@kzc I did the commit all on my mobile phone, so I'm afraid I can't debug any further atm. Let's me get back to you in a couple of hours when I'm back at my desk. |
On master
whereas this harmony PR does call it:
so your original concern about false positive warnings was well founded. I know this is a cop out, but we can drop the warning altogether on both master and harmony. The output is still correct on harmony. It just appears that this harmony PR indirectly calls Edit: Note: in spite of the |
@kzc sounds like a reasonable workaround. I'll give it some more thoughts while getting stuck on the metro. |
The one thing that made me feel uneasy is the indiscriminate elimination of I can cleanly report the warning within |
- consolidate `side-effects` optimisations - improve string `+` optimisation - enhance literal & `conditionals` optimisations
@kzc a0eaff7 corresponds to #1510 (comment) |
#1493 now exposes a bug with |
update exception messages
The only other test failure left is to do with
|
That's minor. Can the test simply be |
Regarding the |
@alexlamsl Looks like you've made really good progress. The remaining test failures are related to wrong start/end positions of AST_Nodes it appears. I guess there were harmony parser changes that inadvertently dropped this info. |
Ah, so it was broken before, but b7bb706 then broke the test output instead of fixing the parser. Restoring |
not sure if `start.pos` is correct, but oh well
All tests passed now 💯 |
@alexlamsl Congrats on the 2.8.0 releases. |
I assumed this PR was merged already. :-) Looks good to merge with a |
Too much to review on my side, sorry :P |
@avdg no worries ;-) |
Tests aren't passing at the moment, as this is just a "straight-forward" merge of source files.
(#1508 was created against the wrong branch. Sorry about that.)