-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/codegen): Fix codegen of
\\0
(#8433)
**Related issue:** - Closes #8431
- Loading branch information
Showing
41 changed files
with
81 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
console.log("\x000"); | ||
console.log("\00"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "ecmascript", | ||
"jsx": false | ||
}, | ||
"target": "es2022", | ||
"loose": false, | ||
"minify": { | ||
"mangle": true, | ||
"compress": { | ||
"defaults": true, | ||
"arguments": true, | ||
"passes": 2 | ||
} | ||
} | ||
}, | ||
"module": { | ||
"type": "es6" | ||
}, | ||
"minify": true, | ||
"isModule": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const exampleCode_0 = '\0'; | ||
export const exampleCode_x00 = '\x00'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const exampleCode_0="\0";export const exampleCode_x00="\0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
var USTAR = "ustar\x0000"; | ||
var USTAR = "ustar\000"; |
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/scannerStringLiteralWithContainingNullCharacter1.1.normal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
//// [scannerStringLiteralWithContainingNullCharacter1.ts] | ||
" \x00 "; | ||
" \0 "; |
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/templateStringControlCharacterEscapes01.1.normal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
//// [templateStringControlCharacterEscapes01.ts] | ||
var x = "\x00\x00\x00 0 00 0000"; | ||
var x = "\0\0\0 0 00 0000"; |
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings01_ES5.1.normal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
//// [unicodeExtendedEscapesInStrings01_ES5.ts] | ||
var x = "\x00"; | ||
var x = "\0"; |
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings02_ES5.1.normal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
//// [unicodeExtendedEscapesInStrings02_ES5.ts] | ||
var x = "\x00"; | ||
var x = "\0"; |
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings03_ES5.1.normal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
//// [unicodeExtendedEscapesInStrings03_ES5.ts] | ||
var x = "\x00"; | ||
var x = "\0"; |
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings04_ES5.1.normal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
//// [unicodeExtendedEscapesInStrings04_ES5.ts] | ||
var x = "\x00"; | ||
var x = "\0"; |
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates01_ES5.1.normal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
//// [unicodeExtendedEscapesInTemplates01_ES5.ts] | ||
var x = "\x00"; | ||
var x = "\0"; |
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates02_ES5.1.normal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
//// [unicodeExtendedEscapesInTemplates02_ES5.ts] | ||
var x = "\x00"; | ||
var x = "\0"; |
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates03_ES5.1.normal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
//// [unicodeExtendedEscapesInTemplates03_ES5.ts] | ||
var x = "\x00"; | ||
var x = "\0"; |
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates04_ES5.1.normal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
//// [unicodeExtendedEscapesInTemplates04_ES5.ts] | ||
var x = "\x00"; | ||
var x = "\0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"use strict";("\x00"); | ||
"use strict";("\0"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"use strict";("\x00x"); | ||
"use strict";("\0x"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"\n\r \v\b\f\\'\"\x00"; | ||
"\n\r \v\b\f\\'\"\0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"Hello\x00World"; | ||
"Hello\0World"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
function a(){"use strict";"\x00"} | ||
function a(){"use strict";"\0"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
("\x00"); | ||
("\0"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
(function(){"use strict";"\x00"}()); | ||
(function(){"use strict";"\0"}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
("\x00"); | ||
("\0"); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
"use strict"; | ||
("\x00"); | ||
("\0"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
"use strict"; | ||
("\x00x"); | ||
("\0x"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"\n\r \v\b\f\\'\"\x00"; | ||
"\n\r \v\b\f\\'\"\0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"Hello\x00World"; | ||
"Hello\0World"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
function a() { | ||
"use strict"; | ||
"\x00"; | ||
"\0"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
("\x00"); | ||
("\0"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(function() { | ||
"use strict"; | ||
"\x00"; | ||
"\0"; | ||
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
("\x00"); | ||
("\0"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
..._minifier/tests/terser/compress/string_literal/octal_escape_sequence/output.mangleOnly.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
var x = "\0\08?\0?Àÿ"; | ||
var a = " 080\x000À0"; | ||
var a = "\0\08?\0?Àÿ"; | ||
var r = " 080\x000À0"; |
2 changes: 1 addition & 1 deletion
2
...wc_ecma_transforms_optimization/tests/__swc_snapshots__/tests/simplify.rs/issue_1619_1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
"use strict"; | ||
console.log("\x001"); | ||
console.log("\01"); |