kzc

Results 96 comments of kzc

This sort of subexpression aliasing proposal comes up a lot. The gzip output is larger. ``` $ cat ex1.js (function() { var doc = new DocumentFragment(); doc.appendChild(new Text('a')); doc.appendChild(new Text('a'));...

> But it could be worth testing this method on big libraries (like angular or react which use a lot of DOM methods) and see Tested a few aliasing variations...

> Should we encourage people to import * for better tree shaking? Thanks to @alexlamsl `uglify-es` has eliminated the `export default` penalty in common scenarios: ```js $ cat mod.js export...

> is uglify-es considered to be stable now? As stable as anything else in the JS ecosystem. Over 500K downloads per week. > that's all and nice in a rollup...

As far as I know [Top Level Await](https://github.com/tc39/proposal-top-level-await) is Stage 3 and is not in the ECMAScript 10th Edition (ES2019) spec. Top Level Await and inlining async functions could be...

The logic outlined in my last post could probably be implemented in a couple of hours - please give it a shot. Search for `AST_Await` and `async` in the sources....

As far as Top Level Await goes for `ecma >= 11` (ES2019+), it would only be applicable if the prospective async function call to be inlined is at top level...

Dropping any `await` is not safe in general as it changes the program's control flow - see https://github.com/terser/terser/issues/528#issuecomment-564213273. Perhaps such an optimization could be supported with `unsafe_await`. As far as...

With eliding `await`s for constants off the table, this feature request can be implemented in a few minutes by altering a condition. Just have to ensure the caller is within...

I wouldn't concentrate on `undefined` in this issue. It doesn't work with regular variables and functions: ``` $ echo 'var a=0; { function a(){} a(); } console.log("PASS");' | bin/uglifyjs -c...