Repository navigation
Commit 52996d7
authored
perf(javascript): mangle a source printed from its SyntaxTree (#22652)
* perf(javascript): mangle a source printed from its SyntaxTree
A minify that mangles names but does not compress now prints from the
SyntaxTree too. analyzeMinifierTree walks the tree as MinifierScopeAnalyzer
walks terser's, pushing the same nodes, so mangleManglingScopes hands out the
same names; each name's definition is held by its node's number. The tree
printer records its print for patchRecording where a string print would
count the same letters, else counts them off a print of its own, and renames
private names in renameMangledEstree's order.
Mangling properties, a name cache, ie8, safari10 and a global keep_*
regexp still print terser's tree.
Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
* perf(javascript): keep an anonymous class's name where keep_classnames is on when mangling a SyntaxTree
Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
* fix(javascript): keep the comments of an empty statement the SyntaxTree printer drops
Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
* test(javascript): mangle anonymous classes a SyntaxTree's declarators name
Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
* test(javascript): refuse a node the SyntaxTree scope analysis cannot read
Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC1 parent a786b43 commit 52996d7
3 files changed
Lines changed: 1891 additions & 97 deletions
File tree
- lib/javascript
- test/unitCases
0 commit comments