You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8eb4eb6
Browse filesBrowse the repository at this point in the historyBrowse files
fix(javascript): scope a parameter list apart from its body in the minifier (#22439)
* fix(javascript): scope a parameter list apart from its body in the minifier
A name a parameter default or catch pattern reads resolved to what the body or block declares, as terser scopes it, so the mangler renamed the read onto the inner binding and the compressor dropped the outer one as unused. Such a read now skips the body's bindings. Moves 42 test262 cases off the printer's list; minifying a 1 MB bundle is within noise.
* fix(javascript): clear parameter ranges once an analysis resolves
An analysis of a copied function counts its reads from zero but met the ranges an earlier analysis left on the scopes around it, so a read in the body could skip a binding there: P(a=q+q+q+q+q) copying h printed "out" for "in". Each analysis now clears its ranges after resolving. Adds the kinds the sweep reached: computed keys, writes, typeof, rest, constructors, setters, generators, const and class.
Keep a name a parameter list or catch parameter reads from resolving to what the function body or catch block declares, which the minifier renamed or dropped as unused.
* @property {boolean=} ie8 whether catch parameters belong to their function
1667
1671
* @property {boolean=} safari10 whether a loop's scope reads its parent's names, and catch parameters belong to their function
1668
1672
* @property {EXPECTED_ANY=} keep_fnames which function names survive, collecting the declarators naming one
1673
+
* @property {boolean=} parameterScopes whether a name read in a parameter list or a catch parameter skips what the body declares, as the spec scopes it
0 commit comments