mirror of
https://github.com/swc-project/swc.git
synced 2024-11-23 09:38:16 +03:00
test(es/codegen): Add a test for fixed issue (#4121)
This commit is contained in:
parent
8d322ef575
commit
95c572f207
86
crates/swc/tests/exec/issue-4120/.swcrc
Normal file
86
crates/swc/tests/exec/issue-4120/.swcrc
Normal file
@ -0,0 +1,86 @@
|
||||
{
|
||||
"sourceMaps": true,
|
||||
"module": {
|
||||
"type": "es6",
|
||||
"strict": true,
|
||||
"noInterop": false
|
||||
},
|
||||
"env": {
|
||||
"targets": "node 12"
|
||||
},
|
||||
"jsc": {
|
||||
"externalHelpers": true,
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"tsx": true,
|
||||
"decorators": false,
|
||||
"dynamicImport": true
|
||||
},
|
||||
"minify": {
|
||||
"compress": {
|
||||
"arguments": false,
|
||||
"arrows": true,
|
||||
"booleans": true,
|
||||
"booleans_as_integers": false,
|
||||
"collapse_vars": true,
|
||||
"comparisons": true,
|
||||
"computed_props": false,
|
||||
"conditionals": false,
|
||||
"dead_code": false,
|
||||
"directives": false,
|
||||
"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": false,
|
||||
"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
|
||||
},
|
||||
"mangle": {
|
||||
"toplevel": false,
|
||||
"keep_classnames": false,
|
||||
"keep_fnames": false,
|
||||
"keep_private_props": false,
|
||||
"ie8": false,
|
||||
"safari10": false
|
||||
}
|
||||
},
|
||||
"keepClassNames": false,
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"./*"
|
||||
],
|
||||
"__shared-fixtures__/*": [
|
||||
"./test/__shared-fixtures__/*"
|
||||
]
|
||||
},
|
||||
"baseUrl": ".",
|
||||
"loose": false
|
||||
},
|
||||
"minify": true
|
||||
}
|
6
crates/swc/tests/exec/issue-4120/exec.js
Normal file
6
crates/swc/tests/exec/issue-4120/exec.js
Normal file
@ -0,0 +1,6 @@
|
||||
const a = "\u0591-\u06ef\u06fa-\u08ff\u200f\ud802-\ud803\ud83a-\ud83b\ufb1d-\ufdff\ufe70-\ufefc";
|
||||
const b = "A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0900-\u1fff\u200e\u2c00-\ud801\ud804-\ud839\ud83c-\udbff\uf900-\ufb1c\ufe00-\ufe6f\ufefd-\uffff";
|
||||
|
||||
|
||||
console.log(a);
|
||||
console.log(b);
|
86
crates/swc/tests/fixture/issue-4120/1/input/.swcrc
Normal file
86
crates/swc/tests/fixture/issue-4120/1/input/.swcrc
Normal file
@ -0,0 +1,86 @@
|
||||
{
|
||||
"sourceMaps": true,
|
||||
"module": {
|
||||
"type": "es6",
|
||||
"strict": true,
|
||||
"noInterop": false
|
||||
},
|
||||
"env": {
|
||||
"targets": "node 12"
|
||||
},
|
||||
"jsc": {
|
||||
"externalHelpers": true,
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"tsx": true,
|
||||
"decorators": false,
|
||||
"dynamicImport": true
|
||||
},
|
||||
"minify": {
|
||||
"compress": {
|
||||
"arguments": false,
|
||||
"arrows": true,
|
||||
"booleans": true,
|
||||
"booleans_as_integers": false,
|
||||
"collapse_vars": true,
|
||||
"comparisons": true,
|
||||
"computed_props": false,
|
||||
"conditionals": false,
|
||||
"dead_code": false,
|
||||
"directives": false,
|
||||
"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": false,
|
||||
"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
|
||||
},
|
||||
"mangle": {
|
||||
"toplevel": false,
|
||||
"keep_classnames": false,
|
||||
"keep_fnames": false,
|
||||
"keep_private_props": false,
|
||||
"ie8": false,
|
||||
"safari10": false
|
||||
}
|
||||
},
|
||||
"keepClassNames": false,
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"./*"
|
||||
],
|
||||
"__shared-fixtures__/*": [
|
||||
"./test/__shared-fixtures__/*"
|
||||
]
|
||||
},
|
||||
"baseUrl": ".",
|
||||
"loose": false
|
||||
},
|
||||
"minify": true
|
||||
}
|
9
crates/swc/tests/fixture/issue-4120/1/input/index.js
Normal file
9
crates/swc/tests/fixture/issue-4120/1/input/index.js
Normal file
@ -0,0 +1,9 @@
|
||||
const a = "\u0591-\u06ef\u06fa-\u08ff\u200f\ud802-\ud803\ud83a-\ud83b\ufb1d-\ufdff\ufe70-\ufefc";
|
||||
// a becomes "\u0591-\u06EF\u06FA-\u08FF\u200F\\\0ud802-\\\0ud803\\\0ud83a-\\\0ud83b\uFB1D-\uFDFF\uFE70-\uFEFC"
|
||||
|
||||
const b = "A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0900-\u1fff\u200e\u2c00-\ud801\ud804-\ud839\ud83c-\udbff\uf900-\ufb1c\ufe00-\ufe6f\ufefd-\uffff";
|
||||
// b becomes "A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02B8\u0300-\u0590\u0900-\u1FFF\u200E\u2C00-\\\0ud801\\\0ud804-\\\0ud839\\\0ud83c-\\\0udbff\uF900-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF"
|
||||
|
||||
// ref: both strings are contained in 'google-protobuf'.
|
||||
|
||||
export default { a, b };
|
1
crates/swc/tests/fixture/issue-4120/1/output/index.js
Normal file
1
crates/swc/tests/fixture/issue-4120/1/output/index.js
Normal file
@ -0,0 +1 @@
|
||||
export default{a:"\u0591-\u06EF\u06FA-\u08FF\u200F\ud802-\ud803\ud83a-\ud83b\uFB1D-\uFDFF\uFE70-\uFEFC",b:"A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02B8\u0300-\u0590\u0900-\u1FFF\u200E\u2C00-\ud801\ud804-\ud839\ud83c-\udbff\uF900-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF"}
|
14
crates/swc/tests/fixture/issue-4120/1/output/index.map
Normal file
14
crates/swc/tests/fixture/issue-4120/1/output/index.map
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"mappings": "AAQA,cAAe,CARiF,AAQ/EA,CAAC,CARR,sFAAsF,AAQ/EA,CALsJ,AAKnJC,CAAC,CALX,mJAA6J,AAKnJA,CAAG,AAAC",
|
||||
"names": [
|
||||
"a",
|
||||
"b"
|
||||
],
|
||||
"sources": [
|
||||
"../../input/index.js"
|
||||
],
|
||||
"sourcesContent": [
|
||||
"const a = \"\\u0591-\\u06ef\\u06fa-\\u08ff\\u200f\\ud802-\\ud803\\ud83a-\\ud83b\\ufb1d-\\ufdff\\ufe70-\\ufefc\";\n// a becomes \"\\u0591-\\u06EF\\u06FA-\\u08FF\\u200F\\\\\\0ud802-\\\\\\0ud803\\\\\\0ud83a-\\\\\\0ud83b\\uFB1D-\\uFDFF\\uFE70-\\uFEFC\"\n\nconst b = \"A-Za-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u02b8\\u0300-\\u0590\\u0900-\\u1fff\\u200e\\u2c00-\\ud801\\ud804-\\ud839\\ud83c-\\udbff\\uf900-\\ufb1c\\ufe00-\\ufe6f\\ufefd-\\uffff\";\n// b becomes \"A-Za-z\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02B8\\u0300-\\u0590\\u0900-\\u1FFF\\u200E\\u2C00-\\\\\\0ud801\\\\\\0ud804-\\\\\\0ud839\\\\\\0ud83c-\\\\\\0udbff\\uF900-\\uFB1C\\uFE00-\\uFE6F\\uFEFD-\\uFFFF\"\n\n// ref: both strings are contained in 'google-protobuf'.\n\nexport default { a, b };"
|
||||
],
|
||||
"version": 3
|
||||
}
|
Loading…
Reference in New Issue
Block a user