-
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
2.8.0 staging #1485
2.8.0 staging #1485
Conversation
Yeah, I should increase the timeout in #1366 |
Updated timeout to |
Tested the follow options on
More from #1485 (comment):
|
2.7.5
This PR
|
|
uh, maybe I didn't do a complete check. The fix was suppose to solve 1 known problem anyway. |
@avdg you are right and I'm just terminally confused 😅 FWIW, I did a search of |
@alexlamsl AFAIK only #1451 conflicts with the other pending PRs. If you changed this PR's title to "2.8.0 staging" then @rvanvelzen could simply merge this for the next release. Mind you, if we did that then the underlying PRs could no longer be updated as changes would not be picked up. |
@kzc may be due you used 3-way merge whereas I did I was thinking @rvanvelzen would do the merge, then compare notes with this PR so we can both catch any problems if they turn out to be different. Let's just say my git-fu is not at the level where I can confidently say I did everything right. 😅 |
Unrelated: I think you could add
|
Also unrelated: in manually going over the files, so far I noticed when |
@kzc your suggested options (& two |
#1485 (comment) boils down to this:
2.7.5 gives:
This PR gives:
|
RegExp literals are tricky. Unlike strings they are not truly constant - they are mutable and hold state. I'd rather err on the side of caution here rather than risk generating bad code. |
(function(){
var result, rx = /ab*/g;
while (result = rx.exec('acdabcdeabbb'))
console.log(result[0]);
})(); |
Agreed, even though I was hoping to have some test failures when I remove FWIW, the corner cases of size regression I've hit can be recovered with that line removed. Which means optimising |
Looking at def(AST_Function, return_false);
def(AST_Object, function(compressor){
for (var i = this.properties.length; --i >= 0;)
if (this.properties[i].has_side_effects(compressor))
return true;
return false;
}); Wouldn't |
Technically a
|
Throwing this at function f() {
var a = {
lastIndex: -1,
flags: "g",
source: "ab*",
exec: function(s) {
return s;
}
};
} ... yields |
I suggested that addition just to be on the safe side.
But since 2.7.5 correctly drops the unused RegExp literal, perhaps this PR is too restrictive and |
If |
I'll remove the line in question from #1459 |
Yes, removing that line makes it hit the
Thanks - I suppose we can add the tests you suggested over there as well. |
@alexlamsl Unused RegExp literal regression addressed in #1459 and new test added. Thanks for catching that. |
Right, with two PRs updated, let me run through this merge exercise again... 😎 |
- `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
89e94b2
to
d48a308
Compare
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
@alexlamsl Here's the thing - |
@alexlamsl Thanks for getting all these features merged into master! Now all you need is npm rights to create a new release. /cc @mishoo @rvanvelzen |
This is a test merge of all 22 open PRs mentioned in #1383 - list of fix-ups:
negate_iife
#1451 - conflicts with fix sequences_limit #1457negate_iife
#1451negate_iife
#1451global_defs
#1469 - conflicts with improve reduce_vars and fix a bug #1473--beautify bracketize
#1483 - conflicts with enhanceglobal_defs
#1469pure_funcs
& improveside_effects
#1494 - conflicts with Support marking a call as pure #1448 & clean upnegate_iife
#1451/cc @avdg @kzc @rvanvelzen