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 9831760
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: lib/javascript/syntax-printer.js
+238-5Lines changed: 238 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,7 @@ const {
85
85
* @property {(stream: OutputStream<PrintNode | number>, value: string) => string | undefined} lineBreakTemplateOf a string written as a template where it saves line break escapes
86
86
* @property {LineBreakTemplates} lineBreakTemplates what decides and writes the templates `lineBreakTemplateOf` writes, for a printer that decides once per source
87
87
* @property {((tree: Node) => LetCounts | null) | undefined} writePendingLets writes the `const` declarations held back as `let`
88
+
* @property {((stream: OutputStream<PrintNode | number>, text: string) => string) | undefined} writeBackticks a program's printed text with its strings written as templates, where the improve phase found every one may be
88
89
* @property {TerserCompressHelpers["common"]} common terser's `compress/common.js`
89
90
* @property {TerserCompressHelpers["inference"]} inference the functions of terser's `compress/inference.js`
/** @typedef {(sources: MinifySources, options?: MinifyOptions) => Promise<MinifyOutput>} Minify what one call to the minifier takes and answers */
320
321
321
-
/** @typedef {{ minify: Minify, phases: string[], corrections?: { enabled: boolean }, improvements?: { enabled: boolean, lets: { enabled: boolean }, literalsLast: { enabled: boolean } }, modules: MinifierModules }} Minifier what a caller minifies with, the switches of its corrections and improvements, and the modules it is built from */
322
+
/** @typedef {{ minify: Minify, phases: string[], corrections?: { enabled: boolean }, improvements?: { enabled: boolean, lets: { enabled: boolean }, literalsLast: { enabled: boolean }, backticks: { enabled: boolean } }, modules: MinifierModules }} Minifier what a caller minifies with, the switches of its corrections and improvements, and the modules it is built from */
322
323
323
324
/**
324
325
* One step building webpack's minifier, installing what it implements onto
/** @typedef {{ enabled: boolean, lets: { enabled: boolean }, literalsLast: { enabled: boolean } }} Improvements the switch the improvements read, one for writing `const` as `let` alone, and one for writing a literal after what an equality compares it with */
21819
+
/** @typedef {{ enabled: boolean, lets: { enabled: boolean }, literalsLast: { enabled: boolean }, backticks: { enabled: boolean } }} Improvements the switch the improvements read, one for writing `const` as `let` alone, one for writing a literal after what an equality compares it with, and one for writing a program's strings as templates */
21820
+
21821
+
/** @typedef {{ stream: OutputStream<PrintNode | number>, starts: number[], blocked: boolean, own: boolean }} BacktickRecord where a program's strings start in a stream's text, whether one printed where no template of its length may, and whether the improve phase is spelling one */
21806
21822
21807
21823
/**
21808
21824
* Installs webpack's improvements on terser: each writes a program terser
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
2
3
-
exports[`ConfigCacheTestCases optimization minify-object-enumeration exported tests should enumerate a string's UTF-16 code units 1`] =`"function(){return[[\\"0\\",\\"1\\"],[\\"a\\",\\"b\\"],[[\\"0\\",\\"a\\"]],[\\"\\\\ud800\\"],[],[],[]]}"`;
3
+
exports[`ConfigCacheTestCases optimization minify-object-enumeration exported tests should enumerate a string's UTF-16 code units 1`] =`"function(){return[[\`0\`,\`1\`],[\`a\`,\`b\`],[[\`0\`,\`a\`]],[\`\\\\ud800\`],[],[],[]]}"`;
4
4
5
-
exports[`ConfigCacheTestCases optimization minify-object-enumeration exported tests should enumerate array literals without reading holes or length 1`] =`"function(){return[[\\"0\\",\\"2\\"],[10,30],[[\\"0\\",10],[\\"2\\",30]],[],[],[]]}"`;
5
+
exports[`ConfigCacheTestCases optimization minify-object-enumeration exported tests should enumerate array literals without reading holes or length 1`] =`"function(){return[[\`0\`,\`2\`],[10,30],[[\`0\`,10],[\`2\`,30]],[],[],[]]}"`;
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
2
3
-
exports[`ConfigTestCases optimization minify-object-enumeration exported tests should enumerate a string's UTF-16 code units 1`] =`"function(){return[[\\"0\\",\\"1\\"],[\\"a\\",\\"b\\"],[[\\"0\\",\\"a\\"]],[\\"\\\\ud800\\"],[],[],[]]}"`;
3
+
exports[`ConfigTestCases optimization minify-object-enumeration exported tests should enumerate a string's UTF-16 code units 1`] =`"function(){return[[\`0\`,\`1\`],[\`a\`,\`b\`],[[\`0\`,\`a\`]],[\`\\\\ud800\`],[],[],[]]}"`;
4
4
5
-
exports[`ConfigTestCases optimization minify-object-enumeration exported tests should enumerate array literals without reading holes or length 1`] =`"function(){return[[\\"0\\",\\"2\\"],[10,30],[[\\"0\\",10],[\\"2\\",30]],[],[],[]]}"`;
5
+
exports[`ConfigTestCases optimization minify-object-enumeration exported tests should enumerate array literals without reading holes or length 1`] =`"function(){return[[\`0\`,\`2\`],[10,30],[[\`0\`,10],[\`2\`,30]],[],[],[]]}"`;
0 commit comments