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 1d89569
Browse filesBrowse the repository at this point in the historyBrowse files
feat(javascript): read camelCase minify option names, terser's kept as aliases
The minifier's options are spelled in camelCase (`keepFnames`, `asciiOnly`,
`dropConsole`, ...) and read that way throughout. terser's snake_case names
stay accepted as aliases, so a terser configuration minifies unchanged; where
a group names both, the camelCase one wins. The default `minimizeOptions`
keep terser's spelling, which terser itself reads outside `futureDefaults`.
Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
Copy file name to clipboardExpand all lines: lib/javascript/ScopeAnalyzer.js
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1319,9 +1319,9 @@ class MinifierLabel {
1319
1319
* @property {boolean=} module whether the program is a module, so strict
1320
1320
* @property {boolean=} ie8 whether catch parameters belong to their function
1321
1321
* @property {boolean=} safari10 whether a loop's scope reads its parent's names, and catch parameters belong to their function
1322
-
* @property {boolean | RegExp=} keep_fnames which function names survive, collecting the declarators naming one
1323
-
* @property {boolean | RegExp=} keep_classnames which class names survive, collecting the declarators naming one under `classDeclarators`
1324
-
* @property {boolean=} classDeclarators whether, under `keep_classnames`, the names declarators give anonymous classes are kept as `keep_fnames` keeps a function's
1322
+
* @property {boolean | RegExp=} keepFnames which function names survive, collecting the declarators naming one
1323
+
* @property {boolean | RegExp=} keepClassnames which class names survive, collecting the declarators naming one under `classDeclarators`
1324
+
* @property {boolean=} classDeclarators whether, under `keepClassnames`, the names declarators give anonymous classes are kept as `keepFnames` keeps a function's
1325
1325
* @property {boolean=} parameterScopes whether names are scoped as the spec scopes them where terser does not: a parameter list's or a catch parameter's reads skip what the body declares, and a block's async or generator function stays in the block
1326
1326
* @property {boolean=} withNames whether a scope a `with` reaches keeps only the names its body spells, mangling the rest
1327
1327
* @property {number=} spelledNames which names to collect that the mangler may give the name beside them to write less: 1 for an import's or export's, 2 for a key's too
@@ -1335,8 +1335,8 @@ class MinifierLabel {
1335
1335
* @property {MinifierLabel[]} labels every label, in the same order
1336
1336
* @property {Map<string, MinifierVariable>} globals the names nothing declares, in the order first read
1337
1337
* @property {Set<MinifierScope>} blockDefunScopes the function scopes holding a function declared in a block
1338
-
* @property {NamedIdentifier[] | null} functionDeclarators under `keep_fnames`, the names declarators give anonymous functions, in the order the mangler asks `keep_fnames` of them
1339
-
* @property {NamedIdentifier[] | null} classDeclarators under `classDeclarators` and `keep_classnames`, the names declarators give anonymous classes
1338
+
* @property {NamedIdentifier[] | null} functionDeclarators under `keepFnames`, the names declarators give anonymous functions, in the order the mangler asks `keepFnames` of them
1339
+
* @property {NamedIdentifier[] | null} classDeclarators under `classDeclarators` and `keepClassnames`, the names declarators give anonymous classes
1340
1340
* @property {NamedIdentifier[]} catchParameters unless `ie8` or `safari10` move them, the catch parameters, each named where the mangler's walk meets its scope
1341
1341
* @property {boolean} namesPrivate whether the program names a private member, which renaming walks it for
1342
1342
* @property {SpelledNames | null} spelledNames under `spelledNames`, the names a key or an import or export spells for a name beside it
@@ -1590,10 +1590,10 @@ class MinifierTreeScopeAnalyzer {
* @property {(node: number) => PrimitiveKind | undefined} nameKind what a name's value converts as, undefined where it is not known
22
22
* @property {(node: number) => boolean} isPureCall whether a call or `new` is marked pure, only its arguments then running code
23
23
* @property {boolean=} pureConversions whether converting a value to a primitive is taken to run no code, as webpack's `isPure` takes it
24
-
* @property {boolean=} comparesConvert whether a comparison or an object's computed key converting what may be an object runs code, as the compressor's `pure_conversions: false` has it
24
+
* @property {boolean=} comparesConvert whether a comparison or an object's computed key converting what may be an object runs code, as the compressor's `pureConversions: false` has it
25
25
* @property {((node: number) => boolean | undefined)=} decides what the caller answers for a node before the rules read it, undefined to leave it to them
26
26
* @property {((node: number) => number)=} readValue the value a name prints as where it is read, 0 for none
27
27
* @property {((node: number) => boolean)=} heritageConstructs whether a class's heritage, past parentheses, is known to be a constructor or `null`, where a class extending anything else may throw; unset, any heritage making nothing happen is taken as one
* @typedef {object} JavascriptReadOptions what the JavaScript `SourceProcessor` reads its source as, and prints it with
20963
20963
* @property {JavascriptSourceType=} sourceType what the source is: a module (the default), a script, or a function's body, a CommonJS module's or an event handler's
20964
-
* @property {Partial<import("./syntax-printer").FormatSettings>=} format terser's format options a print reads, as `minify` reads them under `format`; `comments` is read where it compresses or mangles
20964
+
* @property {import("./syntax-printer").GivenFormatOptions=} format terser's format options a print reads, as `minify` reads them under `format`; `comments` is read where it compresses or mangles
20965
20965
*/
20966
20966
/**
20967
20967
* The JavaScript `SourceProcessor`'s options: a print given `compress` or
0 commit comments