mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 06:36:08 +03:00
fix(es/minifier): Correctly escape more characters (#8490)
**Related issue:** - Closes #8484
This commit is contained in:
parent
a73ddc221e
commit
f7c4934e59
65
crates/swc/tests/fixture/issues-8xxx/8484/input/.swcrc
Normal file
65
crates/swc/tests/fixture/issues-8xxx/8484/input/.swcrc
Normal file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"jsc": {
|
||||
"parser": {
|
||||
"syntax": "ecmascript",
|
||||
"jsx": true,
|
||||
},
|
||||
"target": "es2022",
|
||||
"transform": {
|
||||
"react": {
|
||||
"development": true
|
||||
}
|
||||
},
|
||||
"minify": {
|
||||
"compress": {
|
||||
"arguments": false,
|
||||
"arrows": true,
|
||||
"booleans": true,
|
||||
"booleans_as_integers": false,
|
||||
"collapse_vars": true,
|
||||
"comparisons": true,
|
||||
"computed_props": true,
|
||||
"conditionals": true,
|
||||
"dead_code": true,
|
||||
"directives": true,
|
||||
"drop_console": false,
|
||||
"drop_debugger": true,
|
||||
"evaluate": true,
|
||||
"expression": false,
|
||||
"hoist_funs": false,
|
||||
"hoist_props": true,
|
||||
"hoist_vars": false,
|
||||
"if_return": true,
|
||||
"join_vars": true,
|
||||
"keep_classnames": false,
|
||||
"keep_fargs": true,
|
||||
"keep_fnames": false,
|
||||
"keep_infinity": false,
|
||||
"loops": true,
|
||||
"negate_iife": true,
|
||||
"properties": true,
|
||||
"reduce_funcs": false,
|
||||
"reduce_vars": false,
|
||||
"side_effects": true,
|
||||
"switches": true,
|
||||
"typeofs": true,
|
||||
"unsafe": false,
|
||||
"unsafe_arrows": false,
|
||||
"unsafe_comps": false,
|
||||
"unsafe_Function": false,
|
||||
"unsafe_math": false,
|
||||
"unsafe_symbols": false,
|
||||
"unsafe_methods": false,
|
||||
"unsafe_proto": false,
|
||||
"unsafe_regexp": false,
|
||||
"unsafe_undefined": false,
|
||||
"unused": true,
|
||||
"const_to_let": true,
|
||||
"pristine_globals": true
|
||||
},
|
||||
"mangle": false,
|
||||
"inlineSourcesContent": false
|
||||
}
|
||||
},
|
||||
"minify": false,
|
||||
}
|
1
crates/swc/tests/fixture/issues-8xxx/8484/input/1.js
Normal file
1
crates/swc/tests/fixture/issues-8xxx/8484/input/1.js
Normal file
@ -0,0 +1 @@
|
||||
console.log(`\t`)
|
1
crates/swc/tests/fixture/issues-8xxx/8484/output/1.js
Normal file
1
crates/swc/tests/fixture/issues-8xxx/8484/output/1.js
Normal file
@ -0,0 +1 @@
|
||||
console.log(" ");
|
@ -222,8 +222,12 @@ impl Pure<'_> {
|
||||
let value = c
|
||||
.replace("\\`", "`")
|
||||
.replace("\\$", "$")
|
||||
.replace("\\b", "\u{0008}")
|
||||
.replace("\\f", "\u{000C}")
|
||||
.replace("\\n", "\n")
|
||||
.replace("\\r", "\r")
|
||||
.replace("\\t", "\t")
|
||||
.replace("\\v", "\u{000B}")
|
||||
.replace("\\\\", "\\");
|
||||
|
||||
report_change!("converting a template literal to a string literal");
|
||||
|
Loading…
Reference in New Issue
Block a user