diff --git a/crates/swc/tests/fixture/issue-2423/input/.swcrc b/crates/swc/tests/fixture/issue-2423/input/.swcrc new file mode 100644 index 00000000000..d1eac6f408d --- /dev/null +++ b/crates/swc/tests/fixture/issue-2423/input/.swcrc @@ -0,0 +1,15 @@ +{ + "module": { + "type": "commonjs" + }, + "exclude": [ + ".*.js$" + ], + "jsc": { + "parser": { + "syntax": "typescript" + }, + "target": "es2016" + }, + "sourceMaps": true +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/issue-2423/input/index.ts b/crates/swc/tests/fixture/issue-2423/input/index.ts new file mode 100644 index 00000000000..fdba7059ea1 --- /dev/null +++ b/crates/swc/tests/fixture/issue-2423/input/index.ts @@ -0,0 +1,6 @@ +namespace A { + export const v = 25; + export function a() { + console.log(v); + } +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/issue-2423/output/index.map b/crates/swc/tests/fixture/issue-2423/output/index.map new file mode 100644 index 00000000000..38bef3f209c --- /dev/null +++ b/crates/swc/tests/fixture/issue-2423/output/index.map @@ -0,0 +1,17 @@ +{ + "mappings": "Y;AAAA,GAAS;;QACQA,CAAC,MAADA,CAAC,GAAG,EAAE;aACHC,CAAC,GAAG,CAAC;QACjBC,OAAO,CAACC,GAAG,CAACH,CAAC,CAAC,CAAC;IACnB,CAAC;OAFeC,CAAC,GAADA,CAAC,A;GAFXG,CAAC,KAADA,CAAC,O", + "names": [ + "v", + "a", + "console", + "log", + "A" + ], + "sources": [ + "../../input/index.ts" + ], + "sourcesContent": [ + "namespace A {\n export const v = 25;\n export function a() {\n console.log(v);\n }\n}" + ], + "version": 3 +} diff --git a/crates/swc/tests/fixture/issue-2423/output/index.ts b/crates/swc/tests/fixture/issue-2423/output/index.ts new file mode 100644 index 00000000000..972bc933d51 --- /dev/null +++ b/crates/swc/tests/fixture/issue-2423/output/index.ts @@ -0,0 +1,9 @@ +"use strict"; +var A; +(function(A1) { + var v = A1.v = 25; + function a() { + console.log(v); + } + A1.a = a; +})(A || (A = {})); diff --git a/crates/swc/tests/fixture/issue-2636/input/.swcrc b/crates/swc/tests/fixture/issue-2636/input/.swcrc new file mode 100644 index 00000000000..e4d496ade75 --- /dev/null +++ b/crates/swc/tests/fixture/issue-2636/input/.swcrc @@ -0,0 +1,18 @@ +{ + "jsc": { + "parser": { + "syntax": "typescript", + "tsx": false + }, + "target": "es5", + "loose": false, + "minify": { + "compress": false, + "mangle": false + } + }, + "module": { + "type": "es6" + }, + "minify": false +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/issue-2636/input/index.ts b/crates/swc/tests/fixture/issue-2636/input/index.ts new file mode 100644 index 00000000000..4687444e984 --- /dev/null +++ b/crates/swc/tests/fixture/issue-2636/input/index.ts @@ -0,0 +1,5 @@ +export module RuleInterpreterHelper { + export const fieldNameMap: [string, string][] = []; + + export const fieldNameHashMap: Map = new Map(fieldNameMap); +} diff --git a/crates/swc/tests/fixture/issue-2636/output/index.ts b/crates/swc/tests/fixture/issue-2636/output/index.ts new file mode 100644 index 00000000000..ea47d38c574 --- /dev/null +++ b/crates/swc/tests/fixture/issue-2636/output/index.ts @@ -0,0 +1,5 @@ +export var RuleInterpreterHelper; +(function(RuleInterpreterHelper1) { + var fieldNameMap = RuleInterpreterHelper1.fieldNameMap = []; + var fieldNameHashMap = RuleInterpreterHelper1.fieldNameHashMap = new Map(fieldNameMap); +})(RuleInterpreterHelper || (RuleInterpreterHelper = {}));