();
+//! : ^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/expandoOnAlias_es2015.1.normal.js b/crates/swc/tests/tsc-references/expandoOnAlias_es2015.1.normal.js
index abcef1475b8f..8845c83920af 100644
--- a/crates/swc/tests/tsc-references/expandoOnAlias_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/expandoOnAlias_es2015.1.normal.js
@@ -8,6 +8,8 @@ export class Vue {
export const config = {
x: 0
};
+// @Filename: test.js
+import { Vue, config } from "./vue";
// Expando declarations aren't allowed on aliases.
Vue.config = {};
new Vue();
diff --git a/crates/swc/tests/tsc-references/expandoOnAlias_es2015.2.minified.js b/crates/swc/tests/tsc-references/expandoOnAlias_es2015.2.minified.js
index 6f788f1a117c..ff28b5c0134a 100644
--- a/crates/swc/tests/tsc-references/expandoOnAlias_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/expandoOnAlias_es2015.2.minified.js
@@ -3,4 +3,5 @@ export class Vue {
export const config = {
x: 0
};
+import { Vue, config } from "./vue";
Vue.config = {}, new Vue(), config.x = 1, config.y = {}, config.x, config.y;
diff --git a/crates/swc/tests/tsc-references/expandoOnAlias_es5.1.normal.js b/crates/swc/tests/tsc-references/expandoOnAlias_es5.1.normal.js
index bbc4969cc8b1..a4defdbf792d 100644
--- a/crates/swc/tests/tsc-references/expandoOnAlias_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/expandoOnAlias_es5.1.normal.js
@@ -11,6 +11,8 @@ export var Vue = function Vue() {
export var config = {
x: 0
};
+// @Filename: test.js
+import { Vue, config } from "./vue";
// Expando declarations aren't allowed on aliases.
Vue.config = {};
new Vue();
diff --git a/crates/swc/tests/tsc-references/expandoOnAlias_es5.2.minified.js b/crates/swc/tests/tsc-references/expandoOnAlias_es5.2.minified.js
index cb5c5065c34f..b8beebe20331 100644
--- a/crates/swc/tests/tsc-references/expandoOnAlias_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/expandoOnAlias_es5.2.minified.js
@@ -6,4 +6,5 @@ export var Vue = function() {
export var config = {
x: 0
};
+import { Vue, config } from "./vue";
Vue.config = {}, new Vue(), config.x = 1, config.y = {}, config.x, config.y;
diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands_es2015.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands_es2015.1.normal.js
new file mode 100644
index 000000000000..f3995e47d3d0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands_es2015.1.normal.js
@@ -0,0 +1,54 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 28 | (delete --temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 29 | (delete ++temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 30 | (delete temp--) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 31 | (delete temp++) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 33 | 1 ** (delete --temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 34 | 1 ** (delete ++temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 35 | 1 ** (delete temp--) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 36 | 1 ** (delete temp++) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands_es2015.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands_es2015.2.minified.js
new file mode 100644
index 000000000000..f3995e47d3d0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands_es2015.2.minified.js
@@ -0,0 +1,54 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 28 | (delete --temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 29 | (delete ++temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 30 | (delete temp--) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 31 | (delete temp++) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 33 | 1 ** (delete --temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 34 | 1 ** (delete ++temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 35 | 1 ** (delete temp--) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 36 | 1 ** (delete temp++) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands_es5.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands_es5.1.normal.js
new file mode 100644
index 000000000000..f3995e47d3d0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands_es5.1.normal.js
@@ -0,0 +1,54 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 28 | (delete --temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 29 | (delete ++temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 30 | (delete temp--) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 31 | (delete temp++) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 33 | 1 ** (delete --temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 34 | 1 ** (delete ++temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 35 | 1 ** (delete temp--) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 36 | 1 ** (delete temp++) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands_es5.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands_es5.2.minified.js
new file mode 100644
index 000000000000..f3995e47d3d0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands_es5.2.minified.js
@@ -0,0 +1,54 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 28 | (delete --temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 29 | (delete ++temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 30 | (delete temp--) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 31 | (delete temp++) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 33 | 1 ** (delete --temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 34 | 1 ** (delete ++temp) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 35 | 1 ** (delete temp--) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 36 | 1 ** (delete temp++) ** 3;
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace1_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace1_es2015.2.minified.js
index 29c6e995fd13..4fed2c171188 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace1_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace1_es2015.2.minified.js
@@ -2,6 +2,6 @@ export const a = 1;
export const b = 2;
import * as _ns from './0';
ns.a, ns.b;
+export { _ns as ns };
import * as foo from './1';
foo.ns.a, foo.ns.b;
-export { _ns as ns };
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace1_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace1_es5.2.minified.js
index f911777f1b08..87848916531a 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace1_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace1_es5.2.minified.js
@@ -2,6 +2,6 @@ export var a = 1;
export var b = 2;
import * as _ns from "./0";
ns.a, ns.b;
+export { _ns as ns };
import * as foo from "./1";
foo.ns.a, foo.ns.b;
-export { _ns as ns };
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace2_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace2_es2015.2.minified.js
index 29c6e995fd13..4fed2c171188 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace2_es2015.2.minified.js
@@ -2,6 +2,6 @@ export const a = 1;
export const b = 2;
import * as _ns from './0';
ns.a, ns.b;
+export { _ns as ns };
import * as foo from './1';
foo.ns.a, foo.ns.b;
-export { _ns as ns };
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace2_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace2_es5.2.minified.js
index f911777f1b08..87848916531a 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace2_es5.2.minified.js
@@ -2,6 +2,6 @@ export var a = 1;
export var b = 2;
import * as _ns from "./0";
ns.a, ns.b;
+export { _ns as ns };
import * as foo from "./1";
foo.ns.a, foo.ns.b;
-export { _ns as ns };
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace3_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace3_es2015.2.minified.js
index a62efc186b82..921cea3ce8af 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace3_es2015.2.minified.js
@@ -7,6 +7,6 @@ let ns = {
b: 2
};
ns.a, ns.b;
+export { _ns as ns };
import * as foo from './1';
foo.ns.a, foo.ns.b;
-export { _ns as ns };
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace3_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace3_es5.2.minified.js
index ccda31c568a4..a03b09b96067 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace3_es5.2.minified.js
@@ -7,6 +7,6 @@ var ns = {
b: 2
};
ns.a, ns.b;
+export { _ns as ns };
import * as foo from "./1";
foo.ns.a, foo.ns.b;
-export { _ns as ns };
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace4_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace4_es2015.2.minified.js
index a658445892fe..e996045dddcf 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace4_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace4_es2015.2.minified.js
@@ -1,9 +1,9 @@
export const a = 1;
export const b = 2;
import * as _default from './0';
+export { _default as default };
import * as ns from './0';
export default ns;
import foo from './1';
import foo1 from './11';
foo.a, foo1.a, foo.b, foo1.b;
-export { _default as default };
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace4_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace4_es5.2.minified.js
index 44992d94c1f4..5f8d3a01fea6 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace4_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace4_es5.2.minified.js
@@ -1,9 +1,9 @@
export var a = 1;
export var b = 2;
import * as _default from "./0";
+export { _default as default };
import * as ns from "./0";
export default ns;
import foo from "./1";
import foo1 from "./11";
foo.a, foo1.a, foo.b, foo1.b;
-export { _default as default };
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.1.normal.js
index be2f76a44ba4..37a7874ba342 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.1.normal.js
@@ -2,7 +2,8 @@
// @esModuleInterop: true
// @noTypesAndSymbols: true
// @Filename: a.ts
+module.exports = {};
+export { };
// @Filename: b.ts
import * as _ns from './a';
export { _ns as ns };
-module.exports = {};
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.2.minified.js
index 82cef12d2f5d..3e464787e54e 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es2015.2.minified.js
@@ -1,3 +1,4 @@
-import * as _ns from './a';
module.exports = {};
+export { };
+import * as _ns from './a';
export { _ns as ns };
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.1.normal.js
index 874878fa1303..ee7e26c0c78f 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.1.normal.js
@@ -2,7 +2,8 @@
// @esModuleInterop: true
// @noTypesAndSymbols: true
// @Filename: a.ts
+module.exports = {};
+export { };
// @Filename: b.ts
import * as _ns from "./a";
export { _ns as ns };
-module.exports = {};
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.2.minified.js
index ae955060097b..e3829e3e0136 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace_exportAssignment_es5.2.minified.js
@@ -1,3 +1,4 @@
-import * as _ns from "./a";
module.exports = {};
+export { };
+import * as _ns from "./a";
export { _ns as ns };
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es2015.1.normal.js
index fa63e47ccff8..8e90af7808b3 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es2015.1.normal.js
@@ -3,6 +3,7 @@
// @esModuleInterop: true
// @noTypesAndSymbols: true
// @Filename: a.ts
+export { };
// @Filename: b.ts
import * as _ns from './a'; // Error
export { _ns as ns };
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es2015.2.minified.js
index 07f49aa7475b..5be627cece78 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es2015.2.minified.js
@@ -1,2 +1,3 @@
+export { };
import * as _ns from './a';
export { _ns as ns };
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es5.1.normal.js
index 9ca7bedca622..17b83281a3e4 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es5.1.normal.js
@@ -3,6 +3,7 @@
// @esModuleInterop: true
// @noTypesAndSymbols: true
// @Filename: a.ts
+export { };
// @Filename: b.ts
import * as _ns from "./a"; // Error
export { _ns as ns };
diff --git a/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es5.2.minified.js
index 19c073dfe6b7..c19403e37a27 100644
--- a/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAsNamespace_missingEmitHelpers_es5.2.minified.js
@@ -1,2 +1,3 @@
+export { };
import * as _ns from "./a";
export { _ns as ns };
diff --git a/crates/swc/tests/tsc-references/exportAssignDottedName_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignDottedName_es2015.1.normal.js
index 2c8771785496..0f4044a0e288 100644
--- a/crates/swc/tests/tsc-references/exportAssignDottedName_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignDottedName_es2015.1.normal.js
@@ -5,3 +5,4 @@ export function x() {
// @Filename: foo2.ts
const foo1 = require('./foo1');
module.exports = foo1.x; // Ok
+export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignDottedName_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignDottedName_es2015.2.minified.js
index 941c33650ebc..67139fb389e1 100644
--- a/crates/swc/tests/tsc-references/exportAssignDottedName_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignDottedName_es2015.2.minified.js
@@ -3,3 +3,4 @@ export function x() {
}
let foo1 = require('./foo1');
module.exports = foo1.x;
+export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignDottedName_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignDottedName_es5.1.normal.js
index c9e40315577d..75cb25049ae3 100644
--- a/crates/swc/tests/tsc-references/exportAssignDottedName_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignDottedName_es5.1.normal.js
@@ -5,3 +5,4 @@ export function x() {
// @Filename: foo2.ts
var foo1 = require("./foo1");
module.exports = foo1.x; // Ok
+export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignDottedName_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignDottedName_es5.2.minified.js
index 8507048cd36f..4b1c142d8568 100644
--- a/crates/swc/tests/tsc-references/exportAssignDottedName_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignDottedName_es5.2.minified.js
@@ -3,3 +3,4 @@ export function x() {
}
var foo1 = require("./foo1");
module.exports = foo1.x;
+export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es2015.1.normal.js
index bbf5c101f823..e8a12776e322 100644
--- a/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es2015.1.normal.js
@@ -5,7 +5,9 @@ export function x() {
// @Filename: foo2.ts
const foo1 = require('./foo1');
var x = foo1.x;
+module.exports = x;
+export { };
// @Filename: foo3.ts
const foo2 = require('./foo2');
var x = foo2(); // should be boolean
-module.exports = x;
+export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es2015.2.minified.js
index d4c71a6969ec..76a504a0755d 100644
--- a/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es2015.2.minified.js
@@ -3,6 +3,8 @@ export function x() {
}
let foo1 = require('./foo1');
var x = foo1.x;
-let foo2 = require('./foo2');
-var x = foo2();
module.exports = x;
+export { };
+let foo2 = require('./foo2');
+foo2();
+export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es5.1.normal.js
index a2cb333f8fae..f0bcbec4df45 100644
--- a/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es5.1.normal.js
@@ -5,7 +5,9 @@ export function x() {
// @Filename: foo2.ts
var foo1 = require("./foo1");
var x = foo1.x;
+module.exports = x;
+export { };
// @Filename: foo3.ts
var foo2 = require("./foo2");
var x = foo2(); // should be boolean
-module.exports = x;
+export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es5.2.minified.js
index c6939fe71302..3d42b1942b97 100644
--- a/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignImportedIdentifier_es5.2.minified.js
@@ -1,5 +1,8 @@
export function x() {
return !0;
}
-var x = (require("./foo1").x, require("./foo2")());
+var x = require("./foo1").x;
module.exports = x;
+export { };
+require("./foo2")();
+export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignTypes_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignTypes_es2015.1.normal.js
index 8106dec5f015..d3a23bdf24cd 100644
--- a/crates/swc/tests/tsc-references/exportAssignTypes_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignTypes_es2015.1.normal.js
@@ -1,25 +1,39 @@
// @Filename: expString.ts
var x = "test";
+module.exports = x;
+export { };
// @Filename: expNumber.ts
var x = 42;
+module.exports = x;
+export { };
// @Filename: expBoolean.ts
var x = true;
+module.exports = x;
+export { };
// @Filename: expArray.ts
var x = [
1,
2
];
+module.exports = x;
+export { };
// @Filename: expObject.ts
var x = {
answer: 42,
when: 1776
};
+module.exports = x;
+export { };
// @Filename: expAny.ts
var x;
+module.exports = x;
+export { };
// @Filename: expGeneric.ts
function x(a) {
return a;
}
+module.exports = x;
+export { };
// @Filename: consumer.ts
const iString = require('./expString');
var v1 = iString;
@@ -35,5 +49,4 @@ const iAny = require('./expAny');
var v6 = iAny;
const iGeneric = require('./expGeneric');
var v7 = iGeneric;
-module.exports = x;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignTypes_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignTypes_es2015.2.minified.js
index b608540130b7..2dbdca3d456d 100644
--- a/crates/swc/tests/tsc-references/exportAssignTypes_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignTypes_es2015.2.minified.js
@@ -1,5 +1,26 @@
-require('./expString'), require('./expNumber'), require('./expBoolean'), require('./expArray'), require('./expObject'), require('./expAny'), require('./expGeneric'), module.exports = {
+module.exports = "test";
+export { };
+module.exports = 42;
+export { };
+module.exports = !0;
+export { };
+module.exports = [
+ 1,
+ 2
+];
+export { };
+module.exports = {
answer: 42,
when: 1776
};
export { };
+var x;
+module.exports = x;
+export { };
+function x(a) {
+ return a;
+}
+module.exports = x;
+export { };
+require('./expString'), require('./expNumber'), require('./expBoolean'), require('./expArray'), require('./expObject'), require('./expAny'), require('./expGeneric');
+export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignTypes_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignTypes_es5.1.normal.js
index 47111a351793..c267e3fce817 100644
--- a/crates/swc/tests/tsc-references/exportAssignTypes_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignTypes_es5.1.normal.js
@@ -1,25 +1,39 @@
// @Filename: expString.ts
var x = "test";
+module.exports = x;
+export { };
// @Filename: expNumber.ts
var x = 42;
+module.exports = x;
+export { };
// @Filename: expBoolean.ts
var x = true;
+module.exports = x;
+export { };
// @Filename: expArray.ts
var x = [
1,
2
];
+module.exports = x;
+export { };
// @Filename: expObject.ts
var x = {
answer: 42,
when: 1776
};
+module.exports = x;
+export { };
// @Filename: expAny.ts
var x;
+module.exports = x;
+export { };
// @Filename: expGeneric.ts
function x(a) {
return a;
}
+module.exports = x;
+export { };
// @Filename: consumer.ts
var iString = require("./expString");
var v1 = iString;
@@ -35,5 +49,4 @@ var iAny = require("./expAny");
var v6 = iAny;
var iGeneric = require("./expGeneric");
var v7 = iGeneric;
-module.exports = x;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignTypes_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignTypes_es5.2.minified.js
index d66d2cb9ce52..e31bea161002 100644
--- a/crates/swc/tests/tsc-references/exportAssignTypes_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignTypes_es5.2.minified.js
@@ -1,5 +1,26 @@
-require("./expString"), require("./expNumber"), require("./expBoolean"), require("./expArray"), require("./expObject"), require("./expAny"), require("./expGeneric"), module.exports = {
+module.exports = "test";
+export { };
+module.exports = 42;
+export { };
+module.exports = !0;
+export { };
+module.exports = [
+ 1,
+ 2
+];
+export { };
+module.exports = {
answer: 42,
when: 1776
};
export { };
+var x;
+module.exports = x;
+export { };
+function x(a) {
+ return a;
+}
+module.exports = x;
+export { };
+require("./expString"), require("./expNumber"), require("./expBoolean"), require("./expArray"), require("./expObject"), require("./expAny"), require("./expGeneric");
+export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.1.normal.js
index b7f6c9f7412e..d9e5a69b729e 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.1.normal.js
@@ -5,13 +5,19 @@ var Foo;
(function(Foo) {
var x = Foo.x = foo1.x;
})(Foo || (Foo = {}));
+module.exports = Foo;
+export { };
// @Filename: foo_1.ts
const foo2 = require("./foo_2");
+var Foo;
(function(Foo) {
var x = Foo.x = foo2.x;
})(Foo || (Foo = {}));
+module.exports = Foo;
+export { };
// @Filename: foo_2.ts
const foo0 = require("./foo_0");
+var Foo;
(function(Foo) {
var x = Foo.x = foo0.x;
})(Foo || (Foo = {}));
diff --git a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.2.minified.js
index 22f198bdb79d..06f7f07d90d2 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es2015.2.minified.js
@@ -1,8 +1,12 @@
var Foo;
let foo1 = require('./foo_1');
-(Foo || (Foo = {})).x = foo1.x;
+(Foo || (Foo = {})).x = foo1.x, module.exports = Foo;
+export { };
+var Foo;
let foo2 = require("./foo_2");
-(Foo || (Foo = {})).x = foo2.x;
+(Foo || (Foo = {})).x = foo2.x, module.exports = Foo;
+export { };
+var Foo;
let foo0 = require("./foo_0");
(Foo || (Foo = {})).x = foo0.x, module.exports = Foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.1.normal.js
index 68280dd57eef..2e7f619ed7a9 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.1.normal.js
@@ -5,13 +5,19 @@ var Foo;
(function(Foo) {
var x = Foo.x = foo1.x;
})(Foo || (Foo = {}));
+module.exports = Foo;
+export { };
// @Filename: foo_1.ts
var foo2 = require("./foo_2");
+var Foo;
(function(Foo) {
var x = Foo.x = foo2.x;
})(Foo || (Foo = {}));
+module.exports = Foo;
+export { };
// @Filename: foo_2.ts
var foo0 = require("./foo_0");
+var Foo;
(function(Foo) {
var x = Foo.x = foo0.x;
})(Foo || (Foo = {}));
diff --git a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.2.minified.js
index 936420eb18e9..beeb30a712f4 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentCircularModules_es5.2.minified.js
@@ -1,7 +1,9 @@
var Foo, foo1 = require("./foo_1");
-(Foo || (Foo = {})).x = foo1.x;
-var foo2 = require("./foo_2");
-(Foo || (Foo = {})).x = foo2.x;
-var foo0 = require("./foo_0");
+(Foo || (Foo = {})).x = foo1.x, module.exports = Foo;
+export { };
+var Foo, foo2 = require("./foo_2");
+(Foo || (Foo = {})).x = foo2.x, module.exports = Foo;
+export { };
+var Foo, foo0 = require("./foo_0");
(Foo || (Foo = {})).x = foo0.x, module.exports = Foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.1.normal.js
index 2bfce17bfa89..da10849bfd97 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.1.normal.js
@@ -3,6 +3,8 @@
class Foo {
constructor(x){}
}
+module.exports = Foo;
+export { };
// @Filename: foo_1.ts
const foo = require("./foo_0");
var x = new foo(true); // Should error
@@ -11,5 +13,4 @@ var y = new foo({
b: 42
}); // Should be OK
var z = y.test.b;
-module.exports = Foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.2.minified.js
index 64fe6b1a5819..84ed0c52bf02 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es2015.2.minified.js
@@ -1,8 +1,10 @@
+module.exports = class {
+ constructor(x){}
+};
+export { };
let foo = require("./foo_0");
new foo(!0), new foo({
a: "test",
b: 42
-}).test.b, module.exports = class {
- constructor(x){}
-};
+}).test.b;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es5.1.normal.js
index 63bc3b397c6e..121aa62bd49f 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es5.1.normal.js
@@ -5,6 +5,8 @@ var Foo = function Foo(x) {
"use strict";
_class_call_check(this, Foo);
};
+module.exports = Foo;
+export { };
// @Filename: foo_1.ts
var foo = require("./foo_0");
var x = new foo(true); // Should error
@@ -13,5 +15,4 @@ var y = new foo({
b: 42
}); // Should be OK
var z = y.test.b;
-module.exports = Foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es5.2.minified.js
index 2d8f93d20160..105f26058f15 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentConstrainedGenericType_es5.2.minified.js
@@ -2,8 +2,11 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Foo = function(x) {
"use strict";
_class_call_check(this, Foo);
-}, foo = require("./foo_0");
+};
+module.exports = Foo;
+var foo = require("./foo_0");
new foo(!0), new foo({
a: "test",
b: 42
-}).test.b, module.exports = Foo;
+}).test.b;
+export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentGenericType_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentGenericType_es2015.1.normal.js
index b7b0b3df2dd6..2eceea6009c2 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentGenericType_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentGenericType_es2015.1.normal.js
@@ -2,9 +2,10 @@
// @Filename: foo_0.ts
class Foo {
}
+module.exports = Foo;
+export { };
// @Filename: foo_1.ts
const foo = require("./foo_0");
var x = new foo();
var y = x.test;
-module.exports = Foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentGenericType_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentGenericType_es2015.2.minified.js
index 2bf376689a5b..8886c14f4a47 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentGenericType_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentGenericType_es2015.2.minified.js
@@ -1,4 +1,6 @@
-let foo = require("./foo_0");
-new foo().test, module.exports = class {
+module.exports = class {
};
export { };
+let foo = require("./foo_0");
+new foo().test;
+export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentGenericType_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentGenericType_es5.1.normal.js
index 02063539246a..827fc0b7dd83 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentGenericType_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentGenericType_es5.1.normal.js
@@ -5,9 +5,10 @@ var Foo = function Foo() {
"use strict";
_class_call_check(this, Foo);
};
+module.exports = Foo;
+export { };
// @Filename: foo_1.ts
var foo = require("./foo_0");
var x = new foo();
var y = x.test;
-module.exports = Foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentGenericType_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentGenericType_es5.2.minified.js
index 296c9b4690f2..5201cf157db3 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentGenericType_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentGenericType_es5.2.minified.js
@@ -3,4 +3,6 @@ var Foo = function() {
"use strict";
_class_call_check(this, Foo);
};
-new (require("./foo_0"))().test, module.exports = Foo;
+module.exports = Foo;
+new (require("./foo_0"))().test;
+export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es2015.1.normal.js
index 51f1038e342a..b4c6624d1028 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es2015.1.normal.js
@@ -1,5 +1,7 @@
// @module: amd
// @Filename: foo_0.ts
+module.exports = Foo;
+export { };
// @Filename: foo_1.ts
const foo = require("./foo_0");
var x;
@@ -12,5 +14,4 @@ var z = {
y: 2
};
z = x.d;
-module.exports = Foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es2015.2.minified.js
index c706583cf521..f7d671aadbe8 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es2015.2.minified.js
@@ -1,3 +1,5 @@
+module.exports = Foo;
+export { };
var x;
-require("./foo_0"), x("test"), x(42), x.b, x.c, x.d, module.exports = Foo;
+require("./foo_0"), x("test"), x(42), x.b, x.c, x.d;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es5.1.normal.js
index 685284c17520..6ea47d6de0cd 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es5.1.normal.js
@@ -1,5 +1,7 @@
// @module: amd
// @Filename: foo_0.ts
+module.exports = Foo;
+export { };
// @Filename: foo_1.ts
var foo = require("./foo_0");
var x;
@@ -12,5 +14,4 @@ var z = {
y: 2
};
z = x.d;
-module.exports = Foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es5.2.minified.js
index c706583cf521..f7d671aadbe8 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentMergedInterface_es5.2.minified.js
@@ -1,3 +1,5 @@
+module.exports = Foo;
+export { };
var x;
-require("./foo_0"), x("test"), x(42), x.b, x.c, x.d, module.exports = Foo;
+require("./foo_0"), x("test"), x(42), x.b, x.c, x.d;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.1.normal.js
index 25d4ff11fc02..1548aad5f3bf 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.1.normal.js
@@ -18,11 +18,12 @@ var Foo;
var answer = Test.answer = 42;
})(Test = Foo.Test || (Foo.Test = {}));
})(Foo || (Foo = {}));
+module.exports = Foo;
+export { };
// @Filename: foo_1.ts
const foo = require("./foo_0");
var a = foo.a();
if (!!foo.b) {
foo.Test.answer = foo.c(42);
}
-module.exports = Foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.2.minified.js
index db6e88b3e08c..df3e5878776d 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es2015.2.minified.js
@@ -9,7 +9,8 @@ var Foo;
return a;
}
Foo.c = c, (Foo.Test || (Foo.Test = {})).answer = 42;
-}(Foo || (Foo = {}));
+}(Foo || (Foo = {})), module.exports = Foo;
+export { };
let foo = require("./foo_0");
-foo.a(), foo.b && (foo.Test.answer = foo.c(42)), module.exports = Foo;
+foo.a(), foo.b && (foo.Test.answer = foo.c(42));
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.1.normal.js
index ba0142d1a1c7..e6ac5feb173e 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.1.normal.js
@@ -18,11 +18,12 @@ var Foo;
var answer = Test.answer = 42;
})(Test = Foo.Test || (Foo.Test = {}));
})(Foo || (Foo = {}));
+module.exports = Foo;
+export { };
// @Filename: foo_1.ts
var foo = require("./foo_0");
var a = foo.a();
if (!!foo.b) {
foo.Test.answer = foo.c(42);
}
-module.exports = Foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.2.minified.js
index ca67b24d5cb4..40b291fe9c6c 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentMergedModule_es5.2.minified.js
@@ -1,3 +1,4 @@
+var Foo;
!function(Foo) {
var a = function() {
return 5;
@@ -8,7 +9,8 @@
return a;
};
Foo.c = c, (Foo.Test || (Foo.Test = {})).answer = 42;
-}(Foo || (Foo = {}));
-var Foo, foo = require("./foo_0");
-foo.a(), foo.b && (foo.Test.answer = foo.c(42)), module.exports = Foo;
+}(Foo || (Foo = {})), module.exports = Foo;
+export { };
+var foo = require("./foo_0");
+foo.a(), foo.b && (foo.Test.answer = foo.c(42));
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es2015.1.normal.js
index a084df570a34..57b07db168e2 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es2015.1.normal.js
@@ -5,3 +5,24 @@
// https://github.com/microsoft/TypeScript/issues/39149
import a from "a";
a();
+// @filename: external.d.ts
+//!
+//! x the name `default` is exported multiple times
+//! ,-[6:9]
+//! 6 | export { _a as default };
+//! : ^^^|^^^
+//! : `-- previous exported here
+//! 7 | }
+//! 8 | export default a;
+//! : ^^^^^^^^|^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
+//!
+//! x An export assignment cannot be used in a module with other exported elements.
+//! ,----
+//! 13 | export = a;
+//! : ^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es2015.2.minified.js
index 72798234eb26..654e2b48b88a 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es2015.2.minified.js
@@ -1,2 +1,23 @@
import a from "a";
a();
+// @filename: external.d.ts
+//!
+//! x the name `default` is exported multiple times
+//! ,-[6:9]
+//! 6 | export { _a as default };
+//! : ^^^|^^^
+//! : `-- previous exported here
+//! 7 | }
+//! 8 | export default a;
+//! : ^^^^^^^^|^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
+//!
+//! x An export assignment cannot be used in a module with other exported elements.
+//! ,----
+//! 13 | export = a;
+//! : ^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es5.1.normal.js
index a084df570a34..57b07db168e2 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es5.1.normal.js
@@ -5,3 +5,24 @@
// https://github.com/microsoft/TypeScript/issues/39149
import a from "a";
a();
+// @filename: external.d.ts
+//!
+//! x the name `default` is exported multiple times
+//! ,-[6:9]
+//! 6 | export { _a as default };
+//! : ^^^|^^^
+//! : `-- previous exported here
+//! 7 | }
+//! 8 | export default a;
+//! : ^^^^^^^^|^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
+//!
+//! x An export assignment cannot be used in a module with other exported elements.
+//! ,----
+//! 13 | export = a;
+//! : ^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es5.2.minified.js
index 72798234eb26..654e2b48b88a 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentOfExportNamespaceWithDefault_es5.2.minified.js
@@ -1,2 +1,23 @@
import a from "a";
a();
+// @filename: external.d.ts
+//!
+//! x the name `default` is exported multiple times
+//! ,-[6:9]
+//! 6 | export { _a as default };
+//! : ^^^|^^^
+//! : `-- previous exported here
+//! 7 | }
+//! 8 | export default a;
+//! : ^^^^^^^^|^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
+//!
+//! x An export assignment cannot be used in a module with other exported elements.
+//! ,----
+//! 13 | export = a;
+//! : ^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.1.normal.js
index 6b596b2e581b..dd14074f4baa 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.1.normal.js
@@ -8,10 +8,11 @@ class Foo {
(function(Foo) {
var answer = Foo.answer = 42;
})(Foo || (Foo = {}));
+module.exports = Foo;
+export { };
// @Filename: foo_1.ts
const foo = require("./foo_0");
if (foo.answer === 42) {
var x = new foo();
}
-module.exports = Foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.2.minified.js
index 97254baed801..63dee572a590 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es2015.2.minified.js
@@ -3,7 +3,8 @@ class Foo {
this.test = "test";
}
}
-(Foo || (Foo = {})).answer = 42;
+(Foo || (Foo = {})).answer = 42, module.exports = Foo;
+export { };
let foo = require("./foo_0");
-42 === foo.answer && new foo(), module.exports = Foo;
+42 === foo.answer && new foo();
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.1.normal.js
index 33d2fbd67aeb..403ec06fa9fd 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.1.normal.js
@@ -9,10 +9,11 @@ var Foo = function Foo() {
(function(Foo) {
var answer = Foo.answer = 42;
})(Foo || (Foo = {}));
+module.exports = Foo;
+export { };
// @Filename: foo_1.ts
var foo = require("./foo_0");
if (foo.answer === 42) {
var x = new foo();
}
-module.exports = Foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.2.minified.js
index 4e16cd376446..8c8950b58fe4 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelClodule_es5.2.minified.js
@@ -3,6 +3,7 @@ var Foo = function() {
"use strict";
_class_call_check(this, Foo), this.test = "test";
};
-(Foo || (Foo = {})).answer = 42;
+(Foo || (Foo = {})).answer = 42, module.exports = Foo;
var foo = require("./foo_0");
-42 === foo.answer && new foo(), module.exports = Foo;
+42 === foo.answer && new foo();
+export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.1.normal.js
index 22a026a324fa..e3f3c9b69369 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.1.normal.js
@@ -9,11 +9,12 @@ var foo;
(function(foo) {
var answer = foo.answer = 42;
})(foo || (foo = {}));
+module.exports = foo;
+export { };
// @Filename: foo_1.ts
const foo = require("./foo_0");
var color;
if (color === foo.green) {
color = foo.answer;
}
-module.exports = foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.2.minified.js
index 3a40d38dcaba..f29b17c3135d 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es2015.2.minified.js
@@ -1,7 +1,9 @@
-var foo, color;
+var foo;
!function(foo) {
foo[foo.red = 0] = "red", foo[foo.green = 1] = "green", foo[foo.blue = 2] = "blue";
-}(foo || (foo = {})), (foo || (foo = {})).answer = 42;
+}(foo || (foo = {})), (foo || (foo = {})).answer = 42, module.exports = foo;
+export { };
+var color;
let foo = require("./foo_0");
-color === foo.green && (color = foo.answer), module.exports = foo;
+color === foo.green && (color = foo.answer);
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.1.normal.js
index 5bd7de69866e..e9130b5e3361 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.1.normal.js
@@ -9,11 +9,12 @@ var foo;
(function(foo) {
var answer = foo.answer = 42;
})(foo || (foo = {}));
+module.exports = foo;
+export { };
// @Filename: foo_1.ts
var foo = require("./foo_0");
var color;
if (color === foo.green) {
color = foo.answer;
}
-module.exports = foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.2.minified.js
index 3078df314330..82aec17058eb 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelEnumdule_es5.2.minified.js
@@ -1,6 +1,8 @@
+var foo;
!function(foo) {
foo[foo.red = 0] = "red", foo[foo.green = 1] = "green", foo[foo.blue = 2] = "blue";
-}(foo || (foo = {})), (foo || (foo = {})).answer = 42;
+}(foo || (foo = {})), (foo || (foo = {})).answer = 42, module.exports = foo;
+export { };
var color, foo = require("./foo_0");
-color === foo.green && (color = foo.answer), module.exports = foo;
+color === foo.green && (color = foo.answer);
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.1.normal.js
index 463dc36fcfcc..ca562a155f46 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.1.normal.js
@@ -6,10 +6,11 @@ function foo() {
(function(foo) {
var answer = foo.answer = 42;
})(foo || (foo = {}));
+module.exports = foo;
+export { };
// @Filename: foo_1.ts
const foo = require("./foo_0");
if (foo.answer === 42) {
var x = foo();
}
-module.exports = foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.2.minified.js
index 441cb059e13c..4c6d3bf6da05 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es2015.2.minified.js
@@ -1,7 +1,8 @@
function foo() {
return "test";
}
-(foo || (foo = {})).answer = 42;
+(foo || (foo = {})).answer = 42, module.exports = foo;
+export { };
let foo = require("./foo_0");
-42 === foo.answer && foo(), module.exports = foo;
+42 === foo.answer && foo();
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.1.normal.js
index e213830b6ef4..f921292626e7 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.1.normal.js
@@ -6,10 +6,11 @@ function foo() {
(function(foo) {
var answer = foo.answer = 42;
})(foo || (foo = {}));
+module.exports = foo;
+export { };
// @Filename: foo_1.ts
var foo = require("./foo_0");
if (foo.answer === 42) {
var x = foo();
}
-module.exports = foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.2.minified.js
index 3c86d8278188..a39ad3b2389f 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelFundule_es5.2.minified.js
@@ -1,7 +1,8 @@
function foo() {
return "test";
}
-(foo || (foo = {})).answer = 42;
+(foo || (foo = {})).answer = 42, module.exports = foo;
+export { };
var foo = require("./foo_0");
-42 === foo.answer && foo(), module.exports = foo;
+42 === foo.answer && foo();
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.1.normal.js
index c0ce9698d6d8..52709386f86c 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.1.normal.js
@@ -4,8 +4,9 @@ var Foo;
(function(Foo) {
var answer = Foo.answer = 42;
})(Foo || (Foo = {}));
+module.exports = Foo;
+export { };
// @Filename: foo_1.ts
const foo = require("./foo_0");
if (foo.answer === 42) {}
-module.exports = Foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.2.minified.js
index 0a1aa9d9da18..591a06332174 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es2015.2.minified.js
@@ -1,5 +1,6 @@
var Foo;
-(Foo || (Foo = {})).answer = 42;
+(Foo || (Foo = {})).answer = 42, module.exports = Foo;
+export { };
let foo = require("./foo_0");
-foo.answer, module.exports = Foo;
+foo.answer;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.1.normal.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.1.normal.js
index 16f07a6fab30..c7bc118388a7 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.1.normal.js
@@ -4,8 +4,9 @@ var Foo;
(function(Foo) {
var answer = Foo.answer = 42;
})(Foo || (Foo = {}));
+module.exports = Foo;
+export { };
// @Filename: foo_1.ts
var foo = require("./foo_0");
if (foo.answer === 42) {}
-module.exports = Foo;
export { };
diff --git a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.2.minified.js b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.2.minified.js
index 263e4e333297..92b14e4a119b 100644
--- a/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportAssignmentTopLevelIdentifier_es5.2.minified.js
@@ -1,3 +1,5 @@
var Foo;
-(Foo || (Foo = {})).answer = 42, require("./foo_0").answer, module.exports = Foo;
+(Foo || (Foo = {})).answer = 42, module.exports = Foo;
+export { };
+require("./foo_0").answer;
export { };
diff --git a/crates/swc/tests/tsc-references/exportBinding_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportBinding_es2015.2.minified.js
index 9c69a1606215..95ff294ddedf 100644
--- a/crates/swc/tests/tsc-references/exportBinding_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportBinding_es2015.2.minified.js
@@ -2,6 +2,7 @@ export default x;
let x = 'x';
class Y {
}
+export { x, x as xx, Y as Z };
export default y;
var y = 'y';
-export { x, x as xx, Y as Z, y, y as yy };
+export { y, y as yy };
diff --git a/crates/swc/tests/tsc-references/exportBinding_es5.2.minified.js b/crates/swc/tests/tsc-references/exportBinding_es5.2.minified.js
index 6135683fe263..704c5fe42125 100644
--- a/crates/swc/tests/tsc-references/exportBinding_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportBinding_es5.2.minified.js
@@ -5,6 +5,7 @@ var Y = function Y() {
"use strict";
_class_call_check(this, Y);
};
+export { x, x as xx, Y as Z };
export default y;
var y = "y";
-export { x, x as xx, Y as Z, y, y as yy };
+export { y, y as yy };
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportDeclaration_es2015.1.normal.js
index 90e7536689af..290a81f48727 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_es2015.1.normal.js
@@ -1,5 +1,7 @@
// @Filename: /a.ts
class A {
}
-new A();
export { };
+// @Filename: /b.ts
+import { A } from './a';
+new A();
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportDeclaration_es2015.2.minified.js
index 48e8fdd370be..8c40467167d3 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_es2015.2.minified.js
@@ -1,3 +1,3 @@
-new class {
-}();
export { };
+import { A } from './a';
+new A();
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_es5.1.normal.js b/crates/swc/tests/tsc-references/exportDeclaration_es5.1.normal.js
index 417b7d3bdcc7..ff4643c40be6 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_es5.1.normal.js
@@ -4,5 +4,7 @@ var A = function A() {
"use strict";
_class_call_check(this, A);
};
-new A();
export { };
+// @Filename: /b.ts
+import { A } from "./a";
+new A();
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_es5.2.minified.js b/crates/swc/tests/tsc-references/exportDeclaration_es5.2.minified.js
index 089801082da4..c31013c7035f 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_es5.2.minified.js
@@ -3,4 +3,5 @@ var A = function() {
"use strict";
_class_call_check(this, A);
};
+import { A } from "./a";
new A();
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es2015.1.normal.js
index 23898348954d..fb58a53816fc 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es2015.1.normal.js
@@ -1,3 +1,5 @@
// @isolatedModules: true
// @Filename: /a.ts
+export { };
+// @Filename: /b.ts
export { }; // should not error, but would without `type`
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es2015.2.minified.js
index 2234b9cae16d..98fdd3114198 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es2015.2.minified.js
@@ -1 +1,2 @@
export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es5.1.normal.js b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es5.1.normal.js
index 23898348954d..fb58a53816fc 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es5.1.normal.js
@@ -1,3 +1,5 @@
// @isolatedModules: true
// @Filename: /a.ts
+export { };
+// @Filename: /b.ts
export { }; // should not error, but would without `type`
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es5.2.minified.js b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es5.2.minified.js
index 2234b9cae16d..98fdd3114198 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier-isolatedModules_es5.2.minified.js
@@ -1 +1,2 @@
export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es2015.1.normal.js
index e8c8d5cf6c88..352cca445ecb 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es2015.1.normal.js
@@ -1,4 +1,8 @@
// @Filename: /a.ts
export class A {
}
+// @Filename: /b.ts
+export { };
+// @Filename: /c.ts
+import { A } from './b';
new A();
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es2015.2.minified.js
index add4e8ffa998..cc98b46a10e7 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es2015.2.minified.js
@@ -1,3 +1,5 @@
export class A {
}
+export { };
+import { A } from './b';
new A();
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es5.1.normal.js b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es5.1.normal.js
index d12665f13076..c98dd77399e4 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es5.1.normal.js
@@ -4,4 +4,8 @@ export var A = function A() {
"use strict";
_class_call_check(this, A);
};
+// @Filename: /b.ts
+export { };
+// @Filename: /c.ts
+import { A } from "./b";
new A();
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es5.2.minified.js b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es5.2.minified.js
index 241122599ec8..3a0e45bb5936 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_moduleSpecifier_es5.2.minified.js
@@ -3,4 +3,6 @@ export var A = function() {
"use strict";
_class_call_check(this, A);
};
+export { };
+import { A } from "./b";
new A();
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.1.normal.js
index 29a5380172c5..d174855cdec1 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.1.normal.js
@@ -1,3 +1,5 @@
// @Filename: /a.ts
const A = {};
export const AA = {};
+// @Filename: /b.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.2.minified.js
index daf97fc3901e..5b34d40434bd 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_value_es2015.2.minified.js
@@ -1 +1,2 @@
export const AA = {};
+export { };
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_value_es5.1.normal.js b/crates/swc/tests/tsc-references/exportDeclaration_value_es5.1.normal.js
index 6868bb6a8e19..a107b7313099 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_value_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_value_es5.1.normal.js
@@ -1,3 +1,5 @@
// @Filename: /a.ts
var A = {};
export var AA = {};
+// @Filename: /b.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/exportDeclaration_value_es5.2.minified.js b/crates/swc/tests/tsc-references/exportDeclaration_value_es5.2.minified.js
index 64cf88bfa566..59f66d6afcf2 100644
--- a/crates/swc/tests/tsc-references/exportDeclaration_value_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportDeclaration_value_es5.2.minified.js
@@ -1 +1,2 @@
export var AA = {};
+export { };
diff --git a/crates/swc/tests/tsc-references/exportDeclaredModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportDeclaredModule_es2015.1.normal.js
index 443da21776e2..64576873d876 100644
--- a/crates/swc/tests/tsc-references/exportDeclaredModule_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportDeclaredModule_es2015.1.normal.js
@@ -1,6 +1,7 @@
// @Filename: foo1.ts
+module.exports = M1;
+export { };
// @Filename: foo2.ts
const foo1 = require('./foo1');
var x = foo1.b();
-module.exports = M1;
export { };
diff --git a/crates/swc/tests/tsc-references/exportDeclaredModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportDeclaredModule_es2015.2.minified.js
index bf762b3311d5..d4d8d97758fd 100644
--- a/crates/swc/tests/tsc-references/exportDeclaredModule_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportDeclaredModule_es2015.2.minified.js
@@ -1,3 +1,5 @@
+module.exports = M1;
+export { };
let foo1 = require('./foo1');
-foo1.b(), module.exports = M1;
+foo1.b();
export { };
diff --git a/crates/swc/tests/tsc-references/exportDeclaredModule_es5.1.normal.js b/crates/swc/tests/tsc-references/exportDeclaredModule_es5.1.normal.js
index 02b61d53664d..2a1ebe0fa532 100644
--- a/crates/swc/tests/tsc-references/exportDeclaredModule_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportDeclaredModule_es5.1.normal.js
@@ -1,6 +1,7 @@
// @Filename: foo1.ts
+module.exports = M1;
+export { };
// @Filename: foo2.ts
var foo1 = require("./foo1");
var x = foo1.b();
-module.exports = M1;
export { };
diff --git a/crates/swc/tests/tsc-references/exportDeclaredModule_es5.2.minified.js b/crates/swc/tests/tsc-references/exportDeclaredModule_es5.2.minified.js
index 44d7e3d631c0..26e7c8483c9b 100644
--- a/crates/swc/tests/tsc-references/exportDeclaredModule_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportDeclaredModule_es5.2.minified.js
@@ -1,2 +1,4 @@
-require("./foo1").b(), module.exports = M1;
+module.exports = M1;
+export { };
+require("./foo1").b();
export { };
diff --git a/crates/swc/tests/tsc-references/exportNamespace1_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportNamespace1_es2015.1.normal.js
index 533a56a7b3b0..b5bc93fc5f48 100644
--- a/crates/swc/tests/tsc-references/exportNamespace1_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportNamespace1_es2015.1.normal.js
@@ -1,6 +1,10 @@
// @Filename: a.ts
export class A {
}
+// @Filename: b.ts
+export { };
// @Filename: c.ts
export * from './b';
+// @Filename: d.ts
+import { A } from './c';
new A(); // Error
diff --git a/crates/swc/tests/tsc-references/exportNamespace1_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportNamespace1_es2015.2.minified.js
index 758434a3d14f..082e5a5c6eba 100644
--- a/crates/swc/tests/tsc-references/exportNamespace1_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportNamespace1_es2015.2.minified.js
@@ -1,4 +1,6 @@
export class A {
}
+export { };
export * from './b';
+import { A } from './c';
new A();
diff --git a/crates/swc/tests/tsc-references/exportNamespace1_es5.1.normal.js b/crates/swc/tests/tsc-references/exportNamespace1_es5.1.normal.js
index 1ede7447e213..a107938da162 100644
--- a/crates/swc/tests/tsc-references/exportNamespace1_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportNamespace1_es5.1.normal.js
@@ -4,6 +4,10 @@ export var A = function A() {
"use strict";
_class_call_check(this, A);
};
+// @Filename: b.ts
+export { };
// @Filename: c.ts
export * from "./b";
+// @Filename: d.ts
+import { A } from "./c";
new A(); // Error
diff --git a/crates/swc/tests/tsc-references/exportNamespace1_es5.2.minified.js b/crates/swc/tests/tsc-references/exportNamespace1_es5.2.minified.js
index 5ba682b9945e..0afa99efa2ae 100644
--- a/crates/swc/tests/tsc-references/exportNamespace1_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportNamespace1_es5.2.minified.js
@@ -3,5 +3,7 @@ export var A = function() {
"use strict";
_class_call_check(this, A);
};
+export { };
export * from "./b";
+import { A } from "./c";
new A();
diff --git a/crates/swc/tests/tsc-references/exportNamespace3_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportNamespace3_es2015.1.normal.js
index a63113452812..d07ea7589c12 100644
--- a/crates/swc/tests/tsc-references/exportNamespace3_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportNamespace3_es2015.1.normal.js
@@ -1,6 +1,8 @@
// @Filename: a.ts
export class A {
}
+// @Filename: b.ts
+export { };
// @Filename: c.ts
import * as _a from './b';
export { _a as a };
diff --git a/crates/swc/tests/tsc-references/exportNamespace3_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportNamespace3_es2015.2.minified.js
index ea1bac20ba59..183edf00686c 100644
--- a/crates/swc/tests/tsc-references/exportNamespace3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportNamespace3_es2015.2.minified.js
@@ -1,6 +1,7 @@
export class A {
}
+export { };
import * as _a from './b';
+export { _a as a };
import { a } from './c';
new a.A();
-export { _a as a };
diff --git a/crates/swc/tests/tsc-references/exportNamespace3_es5.1.normal.js b/crates/swc/tests/tsc-references/exportNamespace3_es5.1.normal.js
index b4315a028d98..d4136b9235a4 100644
--- a/crates/swc/tests/tsc-references/exportNamespace3_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportNamespace3_es5.1.normal.js
@@ -4,6 +4,8 @@ export var A = function A() {
"use strict";
_class_call_check(this, A);
};
+// @Filename: b.ts
+export { };
// @Filename: c.ts
import * as _a from "./b";
export { _a as a };
diff --git a/crates/swc/tests/tsc-references/exportNamespace3_es5.2.minified.js b/crates/swc/tests/tsc-references/exportNamespace3_es5.2.minified.js
index 7523c70d92d4..adb9ae38b7c3 100644
--- a/crates/swc/tests/tsc-references/exportNamespace3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportNamespace3_es5.2.minified.js
@@ -3,7 +3,8 @@ export var A = function() {
"use strict";
_class_call_check(this, A);
};
+export { };
import * as _a from "./b";
+export { _a as a };
import { a } from "./c";
new a.A();
-export { _a as a };
diff --git a/crates/swc/tests/tsc-references/exportNestedNamespaces2_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportNestedNamespaces2_es2015.2.minified.js
index 1a65d01ff187..629e2b62e2b4 100644
--- a/crates/swc/tests/tsc-references/exportNestedNamespaces2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportNestedNamespaces2_es2015.2.minified.js
@@ -1,6 +1,8 @@
-exports.formatters = {}, (exports = require('./mod')).formatters.j = function(v) {
+exports.formatters = {};
+(exports = require('./mod')).formatters.j = function(v) {
return v;
-}, (exports = require('./mod')).formatters.o = function(v) {
+};
+(exports = require('./mod')).formatters.o = function(v) {
return v;
};
import * as debug from './mod';
diff --git a/crates/swc/tests/tsc-references/exportNestedNamespaces2_es5.2.minified.js b/crates/swc/tests/tsc-references/exportNestedNamespaces2_es5.2.minified.js
index a484670f022f..926cfc7b7a4e 100644
--- a/crates/swc/tests/tsc-references/exportNestedNamespaces2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportNestedNamespaces2_es5.2.minified.js
@@ -1,6 +1,8 @@
-exports.formatters = {}, (exports = require("./mod")).formatters.j = function(v) {
+exports.formatters = {};
+(exports = require("./mod")).formatters.j = function(v) {
return v;
-}, (exports = require("./mod")).formatters.o = function(v) {
+};
+(exports = require("./mod")).formatters.o = function(v) {
return v;
};
import * as debug from "./mod";
diff --git a/crates/swc/tests/tsc-references/exportNonVisibleType_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportNonVisibleType_es2015.1.normal.js
index 56885ecb620f..bcab9578bbc7 100644
--- a/crates/swc/tests/tsc-references/exportNonVisibleType_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportNonVisibleType_es2015.1.normal.js
@@ -3,9 +3,15 @@ var x = {
a: "test",
b: 42
};
+module.exports = x; // Should fail, I1 not exported.
+export { };
+// @Filename: foo2.ts
class C1 {
}
+module.exports = C1; // Should fail, type I1 of visible member C1.m1 not exported.
+export { };
+// @Filename: foo3.ts
class C1 {
}
-module.exports = x; // Should fail, I1 not exported.
-export { }; // Should work, private type I1 of visible class C1 only used in private member m1.
+module.exports = C1; // Should work, private type I1 of visible class C1 only used in private member m1.
+export { };
diff --git a/crates/swc/tests/tsc-references/exportNonVisibleType_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportNonVisibleType_es2015.2.minified.js
index a9f01bdc5a8e..b36f520bd8bd 100644
--- a/crates/swc/tests/tsc-references/exportNonVisibleType_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportNonVisibleType_es2015.2.minified.js
@@ -3,3 +3,9 @@ module.exports = {
b: 42
};
export { };
+module.exports = class {
+};
+export { };
+module.exports = class {
+};
+export { };
diff --git a/crates/swc/tests/tsc-references/exportNonVisibleType_es5.1.normal.js b/crates/swc/tests/tsc-references/exportNonVisibleType_es5.1.normal.js
index 40909918c4e6..3a08f7117d13 100644
--- a/crates/swc/tests/tsc-references/exportNonVisibleType_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportNonVisibleType_es5.1.normal.js
@@ -1,16 +1,23 @@
// @Filename: foo1.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var x = {
a: "test",
b: 42
};
+module.exports = x; // Should fail, I1 not exported.
+export { };
+// @Filename: foo2.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var C1 = function C1() {
"use strict";
_class_call_check(this, C1);
};
+module.exports = C1; // Should fail, type I1 of visible member C1.m1 not exported.
+export { };
+// @Filename: foo3.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var C1 = function C1() {
"use strict";
_class_call_check(this, C1);
};
-module.exports = x; // Should fail, I1 not exported.
-export { }; // Should work, private type I1 of visible class C1 only used in private member m1.
+module.exports = C1; // Should work, private type I1 of visible class C1 only used in private member m1.
+export { };
diff --git a/crates/swc/tests/tsc-references/exportNonVisibleType_es5.2.minified.js b/crates/swc/tests/tsc-references/exportNonVisibleType_es5.2.minified.js
index e4c822a74269..b18a6925a53d 100644
--- a/crates/swc/tests/tsc-references/exportNonVisibleType_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportNonVisibleType_es5.2.minified.js
@@ -1,12 +1,17 @@
+module.exports = {
+ a: "test",
+ b: 42
+};
+export { };
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var C1 = function() {
"use strict";
_class_call_check(this, C1);
-}, C1 = function() {
+};
+module.exports = C1;
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+var C1 = function() {
"use strict";
_class_call_check(this, C1);
};
-module.exports = {
- a: "test",
- b: 42
-};
+module.exports = C1;
diff --git a/crates/swc/tests/tsc-references/exportSpecifiers_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportSpecifiers_es2015.1.normal.js
new file mode 100644
index 000000000000..789c6c62bb86
--- /dev/null
+++ b/crates/swc/tests/tsc-references/exportSpecifiers_es2015.1.normal.js
@@ -0,0 +1,22 @@
+// @module: esnext
+// @declaration: true
+// @Filename: /imports.ts
+import { type, as, something, foo, bar } from "./exports.js";
+type;
+as; // Error (used in emitting position)
+something; // Error (used in emitting position)
+foo; // Error (used in emitting position)
+bar; // Error (used in emitting position)
+// @Filename: /exports.ts
+//!
+//! x The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.
+//! ,----
+//! 10 | export type { type something as whatever }; // Error
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/exportSpecifiers_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportSpecifiers_es2015.2.minified.js
new file mode 100644
index 000000000000..2b9386a2a765
--- /dev/null
+++ b/crates/swc/tests/tsc-references/exportSpecifiers_es2015.2.minified.js
@@ -0,0 +1,14 @@
+import { type, as, something, foo, bar } from "./exports.js";
+// @Filename: /exports.ts
+//!
+//! x The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.
+//! ,----
+//! 10 | export type { type something as whatever }; // Error
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/exportSpecifiers_es5.1.normal.js b/crates/swc/tests/tsc-references/exportSpecifiers_es5.1.normal.js
new file mode 100644
index 000000000000..789c6c62bb86
--- /dev/null
+++ b/crates/swc/tests/tsc-references/exportSpecifiers_es5.1.normal.js
@@ -0,0 +1,22 @@
+// @module: esnext
+// @declaration: true
+// @Filename: /imports.ts
+import { type, as, something, foo, bar } from "./exports.js";
+type;
+as; // Error (used in emitting position)
+something; // Error (used in emitting position)
+foo; // Error (used in emitting position)
+bar; // Error (used in emitting position)
+// @Filename: /exports.ts
+//!
+//! x The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.
+//! ,----
+//! 10 | export type { type something as whatever }; // Error
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/exportSpecifiers_es5.2.minified.js b/crates/swc/tests/tsc-references/exportSpecifiers_es5.2.minified.js
new file mode 100644
index 000000000000..2b9386a2a765
--- /dev/null
+++ b/crates/swc/tests/tsc-references/exportSpecifiers_es5.2.minified.js
@@ -0,0 +1,14 @@
+import { type, as, something, foo, bar } from "./exports.js";
+// @Filename: /exports.ts
+//!
+//! x The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.
+//! ,----
+//! 10 | export type { type something as whatever }; // Error
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/exportSpellingSuggestion_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportSpellingSuggestion_es2015.1.normal.js
index 75f298d5b5af..f85dc896cf4e 100644
--- a/crates/swc/tests/tsc-references/exportSpellingSuggestion_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportSpellingSuggestion_es2015.1.normal.js
@@ -2,3 +2,5 @@
export function assertNever(x, msg) {
throw new Error("Unexpected " + msg);
}
+// @filename: b.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/exportSpellingSuggestion_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportSpellingSuggestion_es2015.2.minified.js
index b956a70bcf06..b432da2c0bb9 100644
--- a/crates/swc/tests/tsc-references/exportSpellingSuggestion_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportSpellingSuggestion_es2015.2.minified.js
@@ -1,3 +1,4 @@
export function assertNever(x, msg) {
throw Error("Unexpected " + msg);
}
+export { };
diff --git a/crates/swc/tests/tsc-references/exportSpellingSuggestion_es5.1.normal.js b/crates/swc/tests/tsc-references/exportSpellingSuggestion_es5.1.normal.js
index 75f298d5b5af..f85dc896cf4e 100644
--- a/crates/swc/tests/tsc-references/exportSpellingSuggestion_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportSpellingSuggestion_es5.1.normal.js
@@ -2,3 +2,5 @@
export function assertNever(x, msg) {
throw new Error("Unexpected " + msg);
}
+// @filename: b.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/exportSpellingSuggestion_es5.2.minified.js b/crates/swc/tests/tsc-references/exportSpellingSuggestion_es5.2.minified.js
index b956a70bcf06..b432da2c0bb9 100644
--- a/crates/swc/tests/tsc-references/exportSpellingSuggestion_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportSpellingSuggestion_es5.2.minified.js
@@ -1,3 +1,4 @@
export function assertNever(x, msg) {
throw Error("Unexpected " + msg);
}
+export { };
diff --git a/crates/swc/tests/tsc-references/exportStar-amd_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportStar-amd_es2015.1.normal.js
index 5aed27849207..4d4a6d87f32c 100644
--- a/crates/swc/tests/tsc-references/exportStar-amd_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportStar-amd_es2015.1.normal.js
@@ -16,7 +16,7 @@ export * from "./t1";
export * from "./t2";
export * from "./t3";
// @filename: main.ts
-import hello from "./t4";
+import hello, { x, y, z, foo } from "./t4";
hello;
x;
y;
diff --git a/crates/swc/tests/tsc-references/exportStar-amd_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportStar-amd_es2015.2.minified.js
index 4c84bc690c93..d6dc13c371cc 100644
--- a/crates/swc/tests/tsc-references/exportStar-amd_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportStar-amd_es2015.2.minified.js
@@ -3,8 +3,8 @@ export var y = 2;
export default "hello";
export function foo() {}
var x = "x", y = "y", z = "z";
+export { x, y, z };
export * from "./t1";
export * from "./t2";
export * from "./t3";
-import hello from "./t4";
-export { x, y, z };
+import hello, { x, y, z, foo } from "./t4";
diff --git a/crates/swc/tests/tsc-references/exportStar-amd_es5.1.normal.js b/crates/swc/tests/tsc-references/exportStar-amd_es5.1.normal.js
index 5aed27849207..4d4a6d87f32c 100644
--- a/crates/swc/tests/tsc-references/exportStar-amd_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportStar-amd_es5.1.normal.js
@@ -16,7 +16,7 @@ export * from "./t1";
export * from "./t2";
export * from "./t3";
// @filename: main.ts
-import hello from "./t4";
+import hello, { x, y, z, foo } from "./t4";
hello;
x;
y;
diff --git a/crates/swc/tests/tsc-references/exportStar-amd_es5.2.minified.js b/crates/swc/tests/tsc-references/exportStar-amd_es5.2.minified.js
index 4c84bc690c93..d6dc13c371cc 100644
--- a/crates/swc/tests/tsc-references/exportStar-amd_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportStar-amd_es5.2.minified.js
@@ -3,8 +3,8 @@ export var y = 2;
export default "hello";
export function foo() {}
var x = "x", y = "y", z = "z";
+export { x, y, z };
export * from "./t1";
export * from "./t2";
export * from "./t3";
-import hello from "./t4";
-export { x, y, z };
+import hello, { x, y, z, foo } from "./t4";
diff --git a/crates/swc/tests/tsc-references/exportStar_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportStar_es2015.1.normal.js
index 8d7e9a476f05..ed608a37bc95 100644
--- a/crates/swc/tests/tsc-references/exportStar_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportStar_es2015.1.normal.js
@@ -16,7 +16,7 @@ export * from "./t1";
export * from "./t2";
export * from "./t3";
// @filename: main.ts
-import hello from "./t4";
+import hello, { x, y, z, foo } from "./t4";
hello;
x;
y;
diff --git a/crates/swc/tests/tsc-references/exportStar_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportStar_es2015.2.minified.js
index 4c84bc690c93..d6dc13c371cc 100644
--- a/crates/swc/tests/tsc-references/exportStar_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportStar_es2015.2.minified.js
@@ -3,8 +3,8 @@ export var y = 2;
export default "hello";
export function foo() {}
var x = "x", y = "y", z = "z";
+export { x, y, z };
export * from "./t1";
export * from "./t2";
export * from "./t3";
-import hello from "./t4";
-export { x, y, z };
+import hello, { x, y, z, foo } from "./t4";
diff --git a/crates/swc/tests/tsc-references/exportStar_es5.1.normal.js b/crates/swc/tests/tsc-references/exportStar_es5.1.normal.js
index 8d7e9a476f05..ed608a37bc95 100644
--- a/crates/swc/tests/tsc-references/exportStar_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportStar_es5.1.normal.js
@@ -16,7 +16,7 @@ export * from "./t1";
export * from "./t2";
export * from "./t3";
// @filename: main.ts
-import hello from "./t4";
+import hello, { x, y, z, foo } from "./t4";
hello;
x;
y;
diff --git a/crates/swc/tests/tsc-references/exportStar_es5.2.minified.js b/crates/swc/tests/tsc-references/exportStar_es5.2.minified.js
index 4c84bc690c93..d6dc13c371cc 100644
--- a/crates/swc/tests/tsc-references/exportStar_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportStar_es5.2.minified.js
@@ -3,8 +3,8 @@ export var y = 2;
export default "hello";
export function foo() {}
var x = "x", y = "y", z = "z";
+export { x, y, z };
export * from "./t1";
export * from "./t2";
export * from "./t3";
-import hello from "./t4";
-export { x, y, z };
+import hello, { x, y, z, foo } from "./t4";
diff --git a/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es2015.1.normal.js
index 8c7a94911ccf..1ed8b44eebfe 100644
--- a/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es2015.1.normal.js
@@ -7,4 +7,6 @@
b: 2
};
export default MyEnum;
+// @Filename: use.js
+import MyEnum from "./def";
/** @type {MyEnum} */ const v = MyEnum.b;
diff --git a/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es2015.2.minified.js
index 18998e8bb193..16610a945585 100644
--- a/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es2015.2.minified.js
@@ -1,6 +1,6 @@
-let MyEnum = {
+export default {
a: 1,
b: 2
};
-export default MyEnum;
+import MyEnum from "./def";
MyEnum.b;
diff --git a/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es5.1.normal.js b/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es5.1.normal.js
index 1b45e944229a..8f2565da2423 100644
--- a/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es5.1.normal.js
@@ -7,4 +7,6 @@
b: 2
};
export default MyEnum;
+// @Filename: use.js
+import MyEnum from "./def";
/** @type {MyEnum} */ var v = MyEnum.b;
diff --git a/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es5.2.minified.js b/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es5.2.minified.js
index c833b8b78595..16610a945585 100644
--- a/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportedEnumTypeAndValue_es5.2.minified.js
@@ -1,6 +1,6 @@
-var MyEnum = {
+export default {
a: 1,
b: 2
};
-export default MyEnum;
+import MyEnum from "./def";
MyEnum.b;
diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.1.normal.js
index 46632bb65012..6d2b64cf562a 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.1.normal.js
@@ -27,5 +27,5 @@ export { v, f, C, E, D, M, N, a };
// @filename: t2.ts
export { v, f, C, I, E, D, M, N, T, a } from "./t1";
// @filename: t3.ts
-import { I, T } from "./t1";
-export { v, f, C, E, D, M, N, a };
+import { v, f, C, I, E, D, M, N, T, a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.2.minified.js
index ce49edb5459c..864f3e6b1146 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es2015.2.minified.js
@@ -11,6 +11,7 @@ class C {
M.x = x;
}(M || (M = {}));
var a = M.x;
+export { v, f, C, E, D, M, N, a };
export { v, f, C, I, E, D, M, N, T, a } from "./t1";
-import { I, T } from "./t1";
-export { v, f, C, E, D, M, N, a, v, f, C, E, D, M, N, a };
+import { v, f, C, I, E, D, M, N, T, a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.1.normal.js
index 7c16bfafdfaa..c492a65bc438 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.1.normal.js
@@ -30,5 +30,5 @@ export { v, f, C, E, D, M, N, a };
// @filename: t2.ts
export { v, f, C, I, E, D, M, N, T, a } from "./t1";
// @filename: t3.ts
-import { I, T } from "./t1";
-export { v, f, C, E, D, M, N, a };
+import { v, f, C, I, E, D, M, N, T, a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.2.minified.js
index 33a9fc298fcf..c9d773dd2c61 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports1-amd_es5.2.minified.js
@@ -14,6 +14,7 @@ var C = function() {
M.x = x;
}(M || (M = {}));
var a = M.x;
+export { v, f, C, E, D, M, N, a };
export { v, f, C, I, E, D, M, N, T, a } from "./t1";
-import { I, T } from "./t1";
-export { v, f, C, E, D, M, N, a, v, f, C, E, D, M, N, a };
+import { v, f, C, I, E, D, M, N, T, a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.1.normal.js
index 00577ae716a5..bf41fcbcf5f0 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.1.normal.js
@@ -27,5 +27,5 @@ export { v, f, C, E, D, M, N, a };
// @filename: t2.ts
export { v, f, C, I, E, D, M, N, T, a } from "./t1";
// @filename: t3.ts
-import { I, T } from "./t1";
-export { v, f, C, E, D, M, N, a };
+import { v, f, C, I, E, D, M, N, T, a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.2.minified.js
index ce49edb5459c..864f3e6b1146 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es2015.2.minified.js
@@ -11,6 +11,7 @@ class C {
M.x = x;
}(M || (M = {}));
var a = M.x;
+export { v, f, C, E, D, M, N, a };
export { v, f, C, I, E, D, M, N, T, a } from "./t1";
-import { I, T } from "./t1";
-export { v, f, C, E, D, M, N, a, v, f, C, E, D, M, N, a };
+import { v, f, C, I, E, D, M, N, T, a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.1.normal.js
index 71bbf14f37d8..d5cb81f0c4f5 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.1.normal.js
@@ -30,5 +30,5 @@ export { v, f, C, E, D, M, N, a };
// @filename: t2.ts
export { v, f, C, I, E, D, M, N, T, a } from "./t1";
// @filename: t3.ts
-import { I, T } from "./t1";
-export { v, f, C, E, D, M, N, a };
+import { v, f, C, I, E, D, M, N, T, a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.2.minified.js
index 33a9fc298fcf..c9d773dd2c61 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports1-es6_es5.2.minified.js
@@ -14,6 +14,7 @@ var C = function() {
M.x = x;
}(M || (M = {}));
var a = M.x;
+export { v, f, C, E, D, M, N, a };
export { v, f, C, I, E, D, M, N, T, a } from "./t1";
-import { I, T } from "./t1";
-export { v, f, C, E, D, M, N, a, v, f, C, E, D, M, N, a };
+import { v, f, C, I, E, D, M, N, T, a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports1_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports1_es2015.1.normal.js
index 65b68671930e..3bd0be968845 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports1_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports1_es2015.1.normal.js
@@ -26,5 +26,5 @@ export { v, f, C, E, D, M, N, a };
// @filename: t2.ts
export { v, f, C, I, E, D, M, N, T, a } from "./t1";
// @filename: t3.ts
-import { I, T } from "./t1";
-export { v, f, C, E, D, M, N, a };
+import { v, f, C, I, E, D, M, N, T, a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports1_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports1_es2015.2.minified.js
index ce49edb5459c..864f3e6b1146 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports1_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports1_es2015.2.minified.js
@@ -11,6 +11,7 @@ class C {
M.x = x;
}(M || (M = {}));
var a = M.x;
+export { v, f, C, E, D, M, N, a };
export { v, f, C, I, E, D, M, N, T, a } from "./t1";
-import { I, T } from "./t1";
-export { v, f, C, E, D, M, N, a, v, f, C, E, D, M, N, a };
+import { v, f, C, I, E, D, M, N, T, a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports1_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports1_es5.1.normal.js
index 1a4acb58d794..854d756fd142 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports1_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports1_es5.1.normal.js
@@ -29,5 +29,5 @@ export { v, f, C, E, D, M, N, a };
// @filename: t2.ts
export { v, f, C, I, E, D, M, N, T, a } from "./t1";
// @filename: t3.ts
-import { I, T } from "./t1";
-export { v, f, C, E, D, M, N, a };
+import { v, f, C, I, E, D, M, N, T, a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports1_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports1_es5.2.minified.js
index 33a9fc298fcf..c9d773dd2c61 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports1_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports1_es5.2.minified.js
@@ -14,6 +14,7 @@ var C = function() {
M.x = x;
}(M || (M = {}));
var a = M.x;
+export { v, f, C, E, D, M, N, a };
export { v, f, C, I, E, D, M, N, T, a } from "./t1";
-import { I, T } from "./t1";
-export { v, f, C, E, D, M, N, a, v, f, C, E, D, M, N, a };
+import { v, f, C, I, E, D, M, N, T, a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports2-amd_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports2-amd_es2015.1.normal.js
index 1ce61267d0ee..36e1d70233ce 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports2-amd_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports2-amd_es2015.1.normal.js
@@ -5,4 +5,6 @@ export var x = "x";
export var y = "y";
// @filename: t2.ts
export { x as y, y as x } from "./t1";
+// @filename: t3.ts
+import { x, y } from "./t1";
export { x as y, y as x };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports2-amd_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports2-amd_es2015.2.minified.js
index db3df8ccaa63..ca2f1ceecba8 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports2-amd_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports2-amd_es2015.2.minified.js
@@ -1,4 +1,5 @@
export var x = "x";
export var y = "y";
export { x as y, y as x } from "./t1";
+import { x, y } from "./t1";
export { x as y, y as x };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports2-amd_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports2-amd_es5.1.normal.js
index 1ce61267d0ee..36e1d70233ce 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports2-amd_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports2-amd_es5.1.normal.js
@@ -5,4 +5,6 @@ export var x = "x";
export var y = "y";
// @filename: t2.ts
export { x as y, y as x } from "./t1";
+// @filename: t3.ts
+import { x, y } from "./t1";
export { x as y, y as x };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports2-amd_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports2-amd_es5.2.minified.js
index db3df8ccaa63..ca2f1ceecba8 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports2-amd_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports2-amd_es5.2.minified.js
@@ -1,4 +1,5 @@
export var x = "x";
export var y = "y";
export { x as y, y as x } from "./t1";
+import { x, y } from "./t1";
export { x as y, y as x };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports2-es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports2-es6_es2015.1.normal.js
index c8951e6c38f0..b2e4b2128c8c 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports2-es6_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports2-es6_es2015.1.normal.js
@@ -5,4 +5,6 @@ export var x = "x";
export var y = "y";
// @filename: t2.ts
export { x as y, y as x } from "./t1";
+// @filename: t3.ts
+import { x, y } from "./t1";
export { x as y, y as x };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports2-es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports2-es6_es2015.2.minified.js
index db3df8ccaa63..ca2f1ceecba8 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports2-es6_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports2-es6_es2015.2.minified.js
@@ -1,4 +1,5 @@
export var x = "x";
export var y = "y";
export { x as y, y as x } from "./t1";
+import { x, y } from "./t1";
export { x as y, y as x };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports2-es6_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports2-es6_es5.1.normal.js
index c8951e6c38f0..b2e4b2128c8c 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports2-es6_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports2-es6_es5.1.normal.js
@@ -5,4 +5,6 @@ export var x = "x";
export var y = "y";
// @filename: t2.ts
export { x as y, y as x } from "./t1";
+// @filename: t3.ts
+import { x, y } from "./t1";
export { x as y, y as x };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports2-es6_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports2-es6_es5.2.minified.js
index db3df8ccaa63..ca2f1ceecba8 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports2-es6_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports2-es6_es5.2.minified.js
@@ -1,4 +1,5 @@
export var x = "x";
export var y = "y";
export { x as y, y as x } from "./t1";
+import { x, y } from "./t1";
export { x as y, y as x };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports2_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports2_es2015.1.normal.js
index f70d780cee87..8b6c4a5fd9fd 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports2_es2015.1.normal.js
@@ -4,4 +4,6 @@ export var x = "x";
export var y = "y";
// @filename: t2.ts
export { x as y, y as x } from "./t1";
+// @filename: t3.ts
+import { x, y } from "./t1";
export { x as y, y as x };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports2_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports2_es2015.2.minified.js
index db3df8ccaa63..ca2f1ceecba8 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports2_es2015.2.minified.js
@@ -1,4 +1,5 @@
export var x = "x";
export var y = "y";
export { x as y, y as x } from "./t1";
+import { x, y } from "./t1";
export { x as y, y as x };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports2_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports2_es5.1.normal.js
index f70d780cee87..8b6c4a5fd9fd 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports2_es5.1.normal.js
@@ -4,4 +4,6 @@ export var x = "x";
export var y = "y";
// @filename: t2.ts
export { x as y, y as x } from "./t1";
+// @filename: t3.ts
+import { x, y } from "./t1";
export { x as y, y as x };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports2_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports2_es5.2.minified.js
index db3df8ccaa63..ca2f1ceecba8 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports2_es5.2.minified.js
@@ -1,4 +1,5 @@
export var x = "x";
export var y = "y";
export { x as y, y as x } from "./t1";
+import { x, y } from "./t1";
export { x as y, y as x };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.1.normal.js
index 42862603c32a..95c18ca7e563 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.1.normal.js
@@ -27,5 +27,5 @@ export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1
// @filename: t2.ts
export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
// @filename: t3.ts
-import { I1 as I, T1 as T } from "./t1";
-export { v, f, C, E, D, M, N, a };
+import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.2.minified.js
index c99bc4121208..d134368b04c3 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es2015.2.minified.js
@@ -16,6 +16,7 @@ export var M;
M.x = x;
}(M || (M = {}));
export var a = M.x;
+export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1 };
export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
-import { I1 as I, T1 as T } from "./t1";
-export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1, v, f, C, E, D, M, N, a };
+import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.1.normal.js
index 268572aa92dd..a07a72de0db2 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.1.normal.js
@@ -30,5 +30,5 @@ export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1
// @filename: t2.ts
export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
// @filename: t3.ts
-import { I1 as I, T1 as T } from "./t1";
-export { v, f, C, E, D, M, N, a };
+import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.2.minified.js
index 6b8ba3fe3f14..43fef95bcd8b 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports3-amd_es5.2.minified.js
@@ -19,6 +19,7 @@ export var M;
M.x = x;
}(M || (M = {}));
export var a = M.x;
+export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1 };
export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
-import { I1 as I, T1 as T } from "./t1";
-export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1, v, f, C, E, D, M, N, a };
+import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.1.normal.js
index d5b4a2a7f598..0706b511f73a 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.1.normal.js
@@ -27,5 +27,5 @@ export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1
// @filename: t2.ts
export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
// @filename: t3.ts
-import { I1 as I, T1 as T } from "./t1";
-export { v, f, C, E, D, M, N, a };
+import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.2.minified.js
index c99bc4121208..d134368b04c3 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es2015.2.minified.js
@@ -16,6 +16,7 @@ export var M;
M.x = x;
}(M || (M = {}));
export var a = M.x;
+export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1 };
export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
-import { I1 as I, T1 as T } from "./t1";
-export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1, v, f, C, E, D, M, N, a };
+import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.1.normal.js
index cefebafa99ec..b4c6715c80af 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.1.normal.js
@@ -30,5 +30,5 @@ export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1
// @filename: t2.ts
export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
// @filename: t3.ts
-import { I1 as I, T1 as T } from "./t1";
-export { v, f, C, E, D, M, N, a };
+import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.2.minified.js
index 6b8ba3fe3f14..43fef95bcd8b 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports3-es6_es5.2.minified.js
@@ -19,6 +19,7 @@ export var M;
M.x = x;
}(M || (M = {}));
export var a = M.x;
+export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1 };
export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
-import { I1 as I, T1 as T } from "./t1";
-export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1, v, f, C, E, D, M, N, a };
+import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports3_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports3_es2015.1.normal.js
index 903ce1f4f9a8..4129976768e2 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports3_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports3_es2015.1.normal.js
@@ -26,5 +26,5 @@ export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1
// @filename: t2.ts
export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
// @filename: t3.ts
-import { I1 as I, T1 as T } from "./t1";
-export { v, f, C, E, D, M, N, a };
+import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports3_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports3_es2015.2.minified.js
index c99bc4121208..d134368b04c3 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports3_es2015.2.minified.js
@@ -16,6 +16,7 @@ export var M;
M.x = x;
}(M || (M = {}));
export var a = M.x;
+export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1 };
export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
-import { I1 as I, T1 as T } from "./t1";
-export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1, v, f, C, E, D, M, N, a };
+import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports3_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImports3_es5.1.normal.js
index c0c3fa7eeda6..3e990ce20aa6 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports3_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports3_es5.1.normal.js
@@ -29,5 +29,5 @@ export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1
// @filename: t2.ts
export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
// @filename: t3.ts
-import { I1 as I, T1 as T } from "./t1";
-export { v, f, C, E, D, M, N, a };
+import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports3_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports3_es5.2.minified.js
index 6b8ba3fe3f14..43fef95bcd8b 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports3_es5.2.minified.js
@@ -19,6 +19,7 @@ export var M;
M.x = x;
}(M || (M = {}));
export var a = M.x;
+export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1 };
export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
-import { I1 as I, T1 as T } from "./t1";
-export { v as v1, f as f1, C as C1, E as E1, D as D1, M as M1, N as N1, a as a1, v, f, C, E, D, M, N, a };
+import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1";
+export { v, f, C, I, E, D, M, N, T, a };
diff --git a/crates/swc/tests/tsc-references/exportsAndImports4-amd_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports4-amd_es5.2.minified.js
index 352f58103898..601ffead9bfa 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports4-amd_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports4-amd_es5.2.minified.js
@@ -1,6 +1,5 @@
export default "hello";
-var a = require("./t1");
-a.default;
+require("./t1").default;
import b from "./t1";
import * as c from "./t1";
c.default;
diff --git a/crates/swc/tests/tsc-references/exportsAndImports4-es6_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports4-es6_es5.2.minified.js
index 352f58103898..601ffead9bfa 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports4-es6_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports4-es6_es5.2.minified.js
@@ -1,6 +1,5 @@
export default "hello";
-var a = require("./t1");
-a.default;
+require("./t1").default;
import b from "./t1";
import * as c from "./t1";
c.default;
diff --git a/crates/swc/tests/tsc-references/exportsAndImports4_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports4_es5.2.minified.js
index 352f58103898..601ffead9bfa 100644
--- a/crates/swc/tests/tsc-references/exportsAndImports4_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImports4_es5.2.minified.js
@@ -1,6 +1,5 @@
export default "hello";
-var a = require("./t1");
-a.default;
+require("./t1").default;
import b from "./t1";
import * as c from "./t1";
c.default;
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es2015.1.normal.js
index 1664dae5d53a..8b2396cae46c 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es2015.1.normal.js
@@ -3,5 +3,11 @@
// @filename: t1.ts
let as = 100;
export { as as return, as };
+// @filename: t2.ts
+import * as as from "./t1";
var x = as.as;
var y = as.return;
+// @filename: t3.ts
+export { };
+// @filename: t4.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es2015.2.minified.js
index 349adbf66c09..bc58004063fe 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es2015.2.minified.js
@@ -1,2 +1,6 @@
let as = 100;
export { as as return, as };
+import * as as from "./t1";
+as.as, as.return;
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es5.1.normal.js
index 5ab525685517..f6b74e13b14b 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es5.1.normal.js
@@ -3,5 +3,11 @@
// @filename: t1.ts
var as = 100;
export { as as return, as };
+// @filename: t2.ts
+import * as as from "./t1";
var x = as.as;
var y = as.return;
+// @filename: t3.ts
+export { };
+// @filename: t4.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es5.2.minified.js
index f890ee113ec0..30f47b64308f 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithContextualKeywordNames02_es5.2.minified.js
@@ -1,2 +1,6 @@
var as = 100;
export { as as return, as };
+import * as as from "./t1";
+as.as, as.return;
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.1.normal.js
index 687e623b6fbe..533e51c3d6e8 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.1.normal.js
@@ -6,4 +6,6 @@ export default R = {
"__esmodule": true,
"__proto__": {}
};
+// @filename: m2.ts
+import R from "./m1";
const { __esmodule , __proto__ } = R;
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.2.minified.js
index e1a283c09812..483d9459b9e0 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es2015.2.minified.js
@@ -1,6 +1,6 @@
-var R;
-export default R = {
+export default {
"__esmodule": !0,
"__proto__": {}
};
+import R from "./m1";
let { __esmodule , __proto__ } = R;
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.1.normal.js
index 40af1cd4ad34..8ea99088b8d0 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.1.normal.js
@@ -6,4 +6,6 @@ export default R = {
"__esmodule": true,
"__proto__": {}
};
+// @filename: m2.ts
+import R from "./m1";
var __esmodule = R.__esmodule, __proto__ = R.__proto__;
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.2.minified.js
index eeac88e77cbf..271f458a184b 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores2_es5.2.minified.js
@@ -1,6 +1,6 @@
-var R;
-export default R = {
+export default {
"__esmodule": !0,
"__proto__": {}
};
+import R from "./m1";
R.__esmodule, R.__proto__;
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es2015.1.normal.js
index 0f02e87adb03..2dd80206dc6d 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es2015.1.normal.js
@@ -7,4 +7,6 @@ export default R = {
"___hello": 21,
"_hi": 40
};
+// @filename: m2.ts
+import R from "./m1";
const { ___ , ___hello , _hi } = R;
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es2015.2.minified.js
index d7dfa3ab92ac..c90948466dfe 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es2015.2.minified.js
@@ -1,7 +1,7 @@
-var R;
-export default R = {
+export default {
"___": 30,
"___hello": 21,
"_hi": 40
};
+import R from "./m1";
let { ___ , ___hello , _hi } = R;
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es5.1.normal.js
index a1b0a9ef32f0..afa208396463 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es5.1.normal.js
@@ -7,4 +7,6 @@ export default R = {
"___hello": 21,
"_hi": 40
};
+// @filename: m2.ts
+import R from "./m1";
var ___ = R.___, ___hello = R.___hello, _hi = R._hi;
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es5.2.minified.js
index 271be90732cf..1f2c7248925a 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores3_es5.2.minified.js
@@ -1,7 +1,7 @@
-var R;
-export default R = {
+export default {
"___": 30,
"___hello": 21,
"_hi": 40
};
+import R from "./m1";
R.___, R.___hello, R._hi;
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es2015.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es2015.1.normal.js
index f880c4043154..2ff74839d989 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es2015.1.normal.js
@@ -22,6 +22,8 @@ export function __esmodule() {
export function ___hello() {
console.log("___hello");
}
+// @filename: m2.ts
+import { _, __, ___hello, __esmodule, __proto, _hi } from "./m1";
_();
__();
___hello();
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es2015.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es2015.2.minified.js
index c0c879e4294e..f4b61804a844 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es2015.2.minified.js
@@ -19,4 +19,5 @@ export function __esmodule() {
export function ___hello() {
console.log("___hello");
}
+import { _, __, ___hello, __esmodule, __proto, _hi } from "./m1";
_(), __(), ___hello(), __esmodule(), __proto(), _hi();
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es5.1.normal.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es5.1.normal.js
index f880c4043154..2ff74839d989 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es5.1.normal.js
@@ -22,6 +22,8 @@ export function __esmodule() {
export function ___hello() {
console.log("___hello");
}
+// @filename: m2.ts
+import { _, __, ___hello, __esmodule, __proto, _hi } from "./m1";
_();
__();
___hello();
diff --git a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es5.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es5.2.minified.js
index c0c879e4294e..f4b61804a844 100644
--- a/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/exportsAndImportsWithUnderscores4_es5.2.minified.js
@@ -19,4 +19,5 @@ export function __esmodule() {
export function ___hello() {
console.log("___hello");
}
+import { _, __, ___hello, __esmodule, __proto, _hi } from "./m1";
_(), __(), ___hello(), __esmodule(), __proto(), _hi();
diff --git a/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es2015.1.normal.js
index 929ff0f9494e..8eb6c96144ff 100644
--- a/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es2015.1.normal.js
@@ -2,10 +2,11 @@
// @Filename: foo1.ts
class x {
}
+module.exports = x;
+export { };
// @Filename: foo2.ts
const foo1 = require('./foo1');
var x = foo1;
class y extends x {
}
-module.exports = x;
export { };
diff --git a/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es2015.2.minified.js
index 933120f25119..83b870c30ee0 100644
--- a/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es2015.2.minified.js
@@ -1,6 +1,5 @@
-class x {
-}
-let foo1 = require('./foo1');
-var x = foo1;
-module.exports = x;
+module.exports = class {
+};
+export { };
+require('./foo1');
export { };
diff --git a/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.1.normal.js b/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.1.normal.js
index f4acb4b8dea4..177a8dc03aa6 100644
--- a/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.1.normal.js
@@ -1,13 +1,16 @@
// @module: commonjs
// @Filename: foo1.ts
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
var x = function x() {
"use strict";
_class_call_check(this, x);
};
+module.exports = x;
+export { };
// @Filename: foo2.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var foo1 = require("./foo1");
var x = foo1;
var y = /*#__PURE__*/ function(x) {
@@ -20,5 +23,4 @@ var y = /*#__PURE__*/ function(x) {
}
return y;
}(x);
-module.exports = x;
export { };
diff --git a/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.2.minified.js b/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.2.minified.js
index 59d4acb2d24e..6d707d859dbf 100644
--- a/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/extendClassExpressionFromModule_es5.2.minified.js
@@ -1,7 +1,13 @@
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+var x = function() {
+ "use strict";
+ _class_call_check(this, x);
+};
+module.exports = x;
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _inherits from "@swc/helpers/src/_inherits.mjs";
import _create_super from "@swc/helpers/src/_create_super.mjs";
-var x = require("./foo1"), y = function(x) {
+var y = function(x) {
"use strict";
_inherits(y, x);
var _super = _create_super(y);
@@ -9,5 +15,4 @@ var x = require("./foo1"), y = function(x) {
return _class_call_check(this, y), _super.apply(this, arguments);
}
return y;
-}(x);
-module.exports = x;
+}(require("./foo1"));
diff --git a/crates/swc/tests/tsc-references/extendsTagEmit_es2015.1.normal.js b/crates/swc/tests/tsc-references/extendsTagEmit_es2015.1.normal.js
index 445fc42e2f65..a7d9680953a4 100644
--- a/crates/swc/tests/tsc-references/extendsTagEmit_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/extendsTagEmit_es2015.1.normal.js
@@ -5,5 +5,7 @@
// @Filename: super.js
export class B {
}
+// @Filename: main.js
+import { B } from './super';
/** @extends {Mismatch} */ class C extends B {
}
diff --git a/crates/swc/tests/tsc-references/extendsTagEmit_es2015.2.minified.js b/crates/swc/tests/tsc-references/extendsTagEmit_es2015.2.minified.js
index 94fa3c9c47a3..e5d5c3c4580e 100644
--- a/crates/swc/tests/tsc-references/extendsTagEmit_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/extendsTagEmit_es2015.2.minified.js
@@ -1,2 +1,3 @@
export class B {
}
+import { B } from './super';
diff --git a/crates/swc/tests/tsc-references/extendsTagEmit_es5.1.normal.js b/crates/swc/tests/tsc-references/extendsTagEmit_es5.1.normal.js
index 694b27fab756..0dbe99e2349b 100644
--- a/crates/swc/tests/tsc-references/extendsTagEmit_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/extendsTagEmit_es5.1.normal.js
@@ -4,12 +4,15 @@
// @outDir: out
// @Filename: super.js
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
export var B = function B() {
"use strict";
_class_call_check(this, B);
};
+// @Filename: main.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import { B } from "./super";
/** @extends {Mismatch} */ var C = /*#__PURE__*/ function(B) {
"use strict";
_inherits(C, B);
diff --git a/crates/swc/tests/tsc-references/extendsTagEmit_es5.2.minified.js b/crates/swc/tests/tsc-references/extendsTagEmit_es5.2.minified.js
index 4cca4e131a5a..2cf2ca1b0f79 100644
--- a/crates/swc/tests/tsc-references/extendsTagEmit_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/extendsTagEmit_es5.2.minified.js
@@ -1,10 +1,12 @@
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
export var B = function() {
"use strict";
_class_call_check(this, B);
};
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import { B } from "./super";
var C = function(B) {
"use strict";
_inherits(C, B);
diff --git a/crates/swc/tests/tsc-references/filterNamespace_import_es2015.1.normal.js b/crates/swc/tests/tsc-references/filterNamespace_import_es2015.1.normal.js
index 81679d418223..ae90add6933f 100644
--- a/crates/swc/tests/tsc-references/filterNamespace_import_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/filterNamespace_import_es2015.1.normal.js
@@ -13,6 +13,7 @@ var ns;
})(nested = ns.nested || (ns.nested = {}));
})(ns || (ns = {}));
export default ns;
+// @Filename: /a.ts
ns.Class; // Error
ns.Value; // Error
let c;
@@ -20,3 +21,4 @@ let t = "";
let n = {
a: ''
};
+export { };
diff --git a/crates/swc/tests/tsc-references/filterNamespace_import_es2015.2.minified.js b/crates/swc/tests/tsc-references/filterNamespace_import_es2015.2.minified.js
index 2f1745e8f6b8..b10f1c13e8db 100644
--- a/crates/swc/tests/tsc-references/filterNamespace_import_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/filterNamespace_import_es2015.2.minified.js
@@ -6,3 +6,4 @@ var ns;
}(ns || (ns = {}));
export default ns;
ns.Class, ns.Value;
+export { };
diff --git a/crates/swc/tests/tsc-references/filterNamespace_import_es5.1.normal.js b/crates/swc/tests/tsc-references/filterNamespace_import_es5.1.normal.js
index 52e1b538f22a..b91950cf2387 100644
--- a/crates/swc/tests/tsc-references/filterNamespace_import_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/filterNamespace_import_es5.1.normal.js
@@ -18,6 +18,7 @@ var ns;
})(nested = ns.nested || (ns.nested = {}));
})(ns || (ns = {}));
export default ns;
+// @Filename: /a.ts
ns.Class; // Error
ns.Value; // Error
var c;
@@ -25,3 +26,4 @@ var t = "";
var n = {
a: ""
};
+export { };
diff --git a/crates/swc/tests/tsc-references/filterNamespace_import_es5.2.minified.js b/crates/swc/tests/tsc-references/filterNamespace_import_es5.2.minified.js
index c5df595b355a..4a51ef17fbd8 100644
--- a/crates/swc/tests/tsc-references/filterNamespace_import_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/filterNamespace_import_es5.2.minified.js
@@ -12,3 +12,4 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
}(ns || (ns = {}));
export default ns;
ns.Class, ns.Value;
+export { };
diff --git a/crates/swc/tests/tsc-references/for-inStatementsDestructuring3_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-inStatementsDestructuring3_es2015.1.normal.js
new file mode 100644
index 000000000000..11a1c82ce8c7
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-inStatementsDestructuring3_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...in' statement cannot be a destructuring pattern
+//! ,----
+//! 2 | for ([a, b] in []) { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-inStatementsDestructuring3_es2015.2.minified.js b/crates/swc/tests/tsc-references/for-inStatementsDestructuring3_es2015.2.minified.js
new file mode 100644
index 000000000000..11a1c82ce8c7
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-inStatementsDestructuring3_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...in' statement cannot be a destructuring pattern
+//! ,----
+//! 2 | for ([a, b] in []) { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-inStatementsDestructuring3_es5.1.normal.js b/crates/swc/tests/tsc-references/for-inStatementsDestructuring3_es5.1.normal.js
new file mode 100644
index 000000000000..11a1c82ce8c7
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-inStatementsDestructuring3_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...in' statement cannot be a destructuring pattern
+//! ,----
+//! 2 | for ([a, b] in []) { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-inStatementsDestructuring3_es5.2.minified.js b/crates/swc/tests/tsc-references/for-inStatementsDestructuring3_es5.2.minified.js
new file mode 100644
index 000000000000..11a1c82ce8c7
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-inStatementsDestructuring3_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...in' statement cannot be a destructuring pattern
+//! ,----
+//! 2 | for ([a, b] in []) { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-inStatementsDestructuring4_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-inStatementsDestructuring4_es2015.1.normal.js
new file mode 100644
index 000000000000..c9a3f3d99c25
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-inStatementsDestructuring4_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...in' statement cannot be a destructuring pattern
+//! ,----
+//! 2 | for ({a, b} in []) { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-inStatementsDestructuring4_es2015.2.minified.js b/crates/swc/tests/tsc-references/for-inStatementsDestructuring4_es2015.2.minified.js
new file mode 100644
index 000000000000..c9a3f3d99c25
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-inStatementsDestructuring4_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...in' statement cannot be a destructuring pattern
+//! ,----
+//! 2 | for ({a, b} in []) { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-inStatementsDestructuring4_es5.1.normal.js b/crates/swc/tests/tsc-references/for-inStatementsDestructuring4_es5.1.normal.js
new file mode 100644
index 000000000000..c9a3f3d99c25
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-inStatementsDestructuring4_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...in' statement cannot be a destructuring pattern
+//! ,----
+//! 2 | for ({a, b} in []) { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-inStatementsDestructuring4_es5.2.minified.js b/crates/swc/tests/tsc-references/for-inStatementsDestructuring4_es5.2.minified.js
new file mode 100644
index 000000000000..c9a3f3d99c25
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-inStatementsDestructuring4_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...in' statement cannot be a destructuring pattern
+//! ,----
+//! 2 | for ({a, b} in []) { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-inStatementsInvalid_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-inStatementsInvalid_es2015.1.normal.js
new file mode 100644
index 000000000000..496b036738cf
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-inStatementsInvalid_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 10 | for (var idx : number in {}) { }
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-inStatementsInvalid_es2015.2.minified.js b/crates/swc/tests/tsc-references/for-inStatementsInvalid_es2015.2.minified.js
new file mode 100644
index 000000000000..496b036738cf
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-inStatementsInvalid_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 10 | for (var idx : number in {}) { }
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-inStatementsInvalid_es5.1.normal.js b/crates/swc/tests/tsc-references/for-inStatementsInvalid_es5.1.normal.js
new file mode 100644
index 000000000000..496b036738cf
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-inStatementsInvalid_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 10 | for (var idx : number in {}) { }
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-inStatementsInvalid_es5.2.minified.js b/crates/swc/tests/tsc-references/for-inStatementsInvalid_es5.2.minified.js
new file mode 100644
index 000000000000..496b036738cf
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-inStatementsInvalid_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 10 | for (var idx : number in {}) { }
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-of3_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of3_es2015.1.normal.js
new file mode 100644
index 000000000000..4e05e85e39a4
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-of3_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 3 | for (v++ of []) { }
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-of3_es2015.2.minified.js b/crates/swc/tests/tsc-references/for-of3_es2015.2.minified.js
new file mode 100644
index 000000000000..4e05e85e39a4
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-of3_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 3 | for (v++ of []) { }
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-of3_es5.1.normal.js b/crates/swc/tests/tsc-references/for-of3_es5.1.normal.js
new file mode 100644
index 000000000000..4e05e85e39a4
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-of3_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 3 | for (v++ of []) { }
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-of3_es5.2.minified.js b/crates/swc/tests/tsc-references/for-of3_es5.2.minified.js
new file mode 100644
index 000000000000..4e05e85e39a4
--- /dev/null
+++ b/crates/swc/tests/tsc-references/for-of3_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 3 | for (v++ of []) { }
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-of51_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of51_es2015.1.normal.js
index e934906fab3b..cc7d589140da 100644
--- a/crates/swc/tests/tsc-references/for-of51_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/for-of51_es2015.1.normal.js
@@ -1,2 +1,12 @@
-//@target: ES6
-for (let let of []){}
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | for (let let of []) {}
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-of51_es2015.2.minified.js b/crates/swc/tests/tsc-references/for-of51_es2015.2.minified.js
index 855b5bd1764e..cc7d589140da 100644
--- a/crates/swc/tests/tsc-references/for-of51_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/for-of51_es2015.2.minified.js
@@ -1 +1,12 @@
-for (let let of []);
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | for (let let of []) {}
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-of51_es5.1.normal.js b/crates/swc/tests/tsc-references/for-of51_es5.1.normal.js
index 21d4fe206e39..cc7d589140da 100644
--- a/crates/swc/tests/tsc-references/for-of51_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/for-of51_es5.1.normal.js
@@ -1,20 +1,12 @@
-var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
-try {
- //@target: ES6
- for(var _iterator = [][Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
- var let = _step.value;
- }
-} catch (err) {
- _didIteratorError = true;
- _iteratorError = err;
-} finally{
- try {
- if (!_iteratorNormalCompletion && _iterator.return != null) {
- _iterator.return();
- }
- } finally{
- if (_didIteratorError) {
- throw _iteratorError;
- }
- }
-}
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | for (let let of []) {}
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-of51_es5.2.minified.js b/crates/swc/tests/tsc-references/for-of51_es5.2.minified.js
index e83228516385..cc7d589140da 100644
--- a/crates/swc/tests/tsc-references/for-of51_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/for-of51_es5.2.minified.js
@@ -1,12 +1,12 @@
-var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
-try {
- for(var _step, _iterator = [][Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)_step.value;
-} catch (err) {
- _didIteratorError = !0, _iteratorError = err;
-} finally{
- try {
- _iteratorNormalCompletion || null == _iterator.return || _iterator.return();
- } finally{
- if (_didIteratorError) throw _iteratorError;
- }
-}
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | for (let let of []) {}
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-of52_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of52_es2015.1.normal.js
index 5b7c906e370a..5fd66feaa485 100644
--- a/crates/swc/tests/tsc-references/for-of52_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/for-of52_es2015.1.normal.js
@@ -1,4 +1,8 @@
-//@target: ES6
-for (let [v, v] of [
- []
-]){}
+//!
+//! x the name `v` is defined multiple times
+//! ,----
+//! 2 | for (let [v, v] of [[]]) {}
+//! : | |
+//! : | `-- `v` redefined here
+//! : `-- previous definition of `v` here
+//! `----
diff --git a/crates/swc/tests/tsc-references/for-of52_es2015.2.minified.js b/crates/swc/tests/tsc-references/for-of52_es2015.2.minified.js
index dc64d7afe741..5fd66feaa485 100644
--- a/crates/swc/tests/tsc-references/for-of52_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/for-of52_es2015.2.minified.js
@@ -1,3 +1,8 @@
-for (let [v, v] of [
- []
-]);
+//!
+//! x the name `v` is defined multiple times
+//! ,----
+//! 2 | for (let [v, v] of [[]]) {}
+//! : | |
+//! : | `-- `v` redefined here
+//! : `-- previous definition of `v` here
+//! `----
diff --git a/crates/swc/tests/tsc-references/for-of52_es5.1.normal.js b/crates/swc/tests/tsc-references/for-of52_es5.1.normal.js
index a292d724df1f..5fd66feaa485 100644
--- a/crates/swc/tests/tsc-references/for-of52_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/for-of52_es5.1.normal.js
@@ -1,7 +1,8 @@
-//@target: ES6
-import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
-for(var _i = 0, _iter = [
- []
-]; _i < _iter.length; _i++){
- var __i = _sliced_to_array(_iter[_i], 2), v = __i[0], v = __i[1];
-}
+//!
+//! x the name `v` is defined multiple times
+//! ,----
+//! 2 | for (let [v, v] of [[]]) {}
+//! : | |
+//! : | `-- `v` redefined here
+//! : `-- previous definition of `v` here
+//! `----
diff --git a/crates/swc/tests/tsc-references/for-of52_es5.2.minified.js b/crates/swc/tests/tsc-references/for-of52_es5.2.minified.js
index 628aaedbd7fc..5fd66feaa485 100644
--- a/crates/swc/tests/tsc-references/for-of52_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/for-of52_es5.2.minified.js
@@ -1,7 +1,8 @@
-import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
-for(var _i = 0, _iter = [
- []
-]; _i < _iter.length; _i++){
- var __i = _sliced_to_array(_iter[_i], 2);
- __i[0], __i[1];
-}
+//!
+//! x the name `v` is defined multiple times
+//! ,----
+//! 2 | for (let [v, v] of [[]]) {}
+//! : | |
+//! : | `-- `v` redefined here
+//! : `-- previous definition of `v` here
+//! `----
diff --git a/crates/swc/tests/tsc-references/for-of56_es2015.1.normal.js b/crates/swc/tests/tsc-references/for-of56_es2015.1.normal.js
index ab71a721a687..5a4826522773 100644
--- a/crates/swc/tests/tsc-references/for-of56_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/for-of56_es2015.1.normal.js
@@ -1,2 +1,12 @@
-//@target: ES6
-for (var let of []){}
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | for (var let of []) {}
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-of56_es2015.2.minified.js b/crates/swc/tests/tsc-references/for-of56_es2015.2.minified.js
index b41503aa72f7..5a4826522773 100644
--- a/crates/swc/tests/tsc-references/for-of56_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/for-of56_es2015.2.minified.js
@@ -1 +1,12 @@
-for (var let of []);
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | for (var let of []) {}
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-of56_es5.1.normal.js b/crates/swc/tests/tsc-references/for-of56_es5.1.normal.js
index 21d4fe206e39..5a4826522773 100644
--- a/crates/swc/tests/tsc-references/for-of56_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/for-of56_es5.1.normal.js
@@ -1,20 +1,12 @@
-var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
-try {
- //@target: ES6
- for(var _iterator = [][Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
- var let = _step.value;
- }
-} catch (err) {
- _didIteratorError = true;
- _iteratorError = err;
-} finally{
- try {
- if (!_iteratorNormalCompletion && _iterator.return != null) {
- _iterator.return();
- }
- } finally{
- if (_didIteratorError) {
- throw _iteratorError;
- }
- }
-}
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | for (var let of []) {}
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/for-of56_es5.2.minified.js b/crates/swc/tests/tsc-references/for-of56_es5.2.minified.js
index e83228516385..5a4826522773 100644
--- a/crates/swc/tests/tsc-references/for-of56_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/for-of56_es5.2.minified.js
@@ -1,12 +1,12 @@
-var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
-try {
- for(var _step, _iterator = [][Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)_step.value;
-} catch (err) {
- _didIteratorError = !0, _iteratorError = err;
-} finally{
- try {
- _iteratorNormalCompletion || null == _iterator.return || _iterator.return();
- } finally{
- if (_didIteratorError) throw _iteratorError;
- }
-}
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | for (var let of []) {}
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/functionNameConflicts_es2015.1.normal.js b/crates/swc/tests/tsc-references/functionNameConflicts_es2015.1.normal.js
index 3d97b072d55a..1db5997ab809 100644
--- a/crates/swc/tests/tsc-references/functionNameConflicts_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/functionNameConflicts_es2015.1.normal.js
@@ -1,18 +1,30 @@
-//Function and variable of the same name in same declaration space
-//Function overload with different name from implementation signature
-var M;
-(function(M) {
- function fn1() {}
- var fn1;
- var fn2;
- function fn2() {}
-})(M || (M = {}));
-function fn3() {}
-var fn3;
-function func() {
- var fn4;
- function fn4() {}
- function fn5() {}
- var fn5;
-}
-function overrr() {}
+//!
+//! x the name `fn1` is defined multiple times
+//! ,-[5:5]
+//! 5 | function fn1() { }
+//! : ^|^
+//! : `-- previous definition of `fn1` here
+//! 6 | var fn1;
+//! : ^|^
+//! : `-- `fn1` redefined here
+//! `----
+//!
+//! x the name `fn2` is defined multiple times
+//! ,-[8:5]
+//! 8 | var fn2;
+//! : ^|^
+//! : `-- previous definition of `fn2` here
+//! 9 | function fn2() { }
+//! : ^|^
+//! : `-- `fn2` redefined here
+//! `----
+//!
+//! x the name `fn3` is defined multiple times
+//! ,-[12:1]
+//! 12 | function fn3() { }
+//! : ^|^
+//! : `-- previous definition of `fn3` here
+//! 13 | var fn3;
+//! : ^|^
+//! : `-- `fn3` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/functionNameConflicts_es2015.2.minified.js b/crates/swc/tests/tsc-references/functionNameConflicts_es2015.2.minified.js
index cf77a4b72fa5..1db5997ab809 100644
--- a/crates/swc/tests/tsc-references/functionNameConflicts_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/functionNameConflicts_es2015.2.minified.js
@@ -1,2 +1,30 @@
-var M;
-M || (M = {});
+//!
+//! x the name `fn1` is defined multiple times
+//! ,-[5:5]
+//! 5 | function fn1() { }
+//! : ^|^
+//! : `-- previous definition of `fn1` here
+//! 6 | var fn1;
+//! : ^|^
+//! : `-- `fn1` redefined here
+//! `----
+//!
+//! x the name `fn2` is defined multiple times
+//! ,-[8:5]
+//! 8 | var fn2;
+//! : ^|^
+//! : `-- previous definition of `fn2` here
+//! 9 | function fn2() { }
+//! : ^|^
+//! : `-- `fn2` redefined here
+//! `----
+//!
+//! x the name `fn3` is defined multiple times
+//! ,-[12:1]
+//! 12 | function fn3() { }
+//! : ^|^
+//! : `-- previous definition of `fn3` here
+//! 13 | var fn3;
+//! : ^|^
+//! : `-- `fn3` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/functionNameConflicts_es5.1.normal.js b/crates/swc/tests/tsc-references/functionNameConflicts_es5.1.normal.js
index 5eb1ec8f8b27..1db5997ab809 100644
--- a/crates/swc/tests/tsc-references/functionNameConflicts_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/functionNameConflicts_es5.1.normal.js
@@ -1,18 +1,30 @@
-//Function and variable of the same name in same declaration space
-//Function overload with different name from implementation signature
-var M;
-(function(M) {
- var fn1 = function fn1() {};
- var fn2 = function fn2() {};
- var fn1;
- var fn2;
-})(M || (M = {}));
-function fn3() {}
-var fn3;
-function func() {
- var fn4 = function fn4() {};
- var fn5 = function fn5() {};
- var fn4;
- var fn5;
-}
-function overrr() {}
+//!
+//! x the name `fn1` is defined multiple times
+//! ,-[5:5]
+//! 5 | function fn1() { }
+//! : ^|^
+//! : `-- previous definition of `fn1` here
+//! 6 | var fn1;
+//! : ^|^
+//! : `-- `fn1` redefined here
+//! `----
+//!
+//! x the name `fn2` is defined multiple times
+//! ,-[8:5]
+//! 8 | var fn2;
+//! : ^|^
+//! : `-- previous definition of `fn2` here
+//! 9 | function fn2() { }
+//! : ^|^
+//! : `-- `fn2` redefined here
+//! `----
+//!
+//! x the name `fn3` is defined multiple times
+//! ,-[12:1]
+//! 12 | function fn3() { }
+//! : ^|^
+//! : `-- previous definition of `fn3` here
+//! 13 | var fn3;
+//! : ^|^
+//! : `-- `fn3` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/functionNameConflicts_es5.2.minified.js b/crates/swc/tests/tsc-references/functionNameConflicts_es5.2.minified.js
index cf77a4b72fa5..1db5997ab809 100644
--- a/crates/swc/tests/tsc-references/functionNameConflicts_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/functionNameConflicts_es5.2.minified.js
@@ -1,2 +1,30 @@
-var M;
-M || (M = {});
+//!
+//! x the name `fn1` is defined multiple times
+//! ,-[5:5]
+//! 5 | function fn1() { }
+//! : ^|^
+//! : `-- previous definition of `fn1` here
+//! 6 | var fn1;
+//! : ^|^
+//! : `-- `fn1` redefined here
+//! `----
+//!
+//! x the name `fn2` is defined multiple times
+//! ,-[8:5]
+//! 8 | var fn2;
+//! : ^|^
+//! : `-- previous definition of `fn2` here
+//! 9 | function fn2() { }
+//! : ^|^
+//! : `-- `fn2` redefined here
+//! `----
+//!
+//! x the name `fn3` is defined multiple times
+//! ,-[12:1]
+//! 12 | function fn3() { }
+//! : ^|^
+//! : `-- previous definition of `fn3` here
+//! 13 | var fn3;
+//! : ^|^
+//! : `-- `fn3` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/functionOverloadErrors_es2015.1.normal.js b/crates/swc/tests/tsc-references/functionOverloadErrors_es2015.1.normal.js
new file mode 100644
index 000000000000..3747e6c0755b
--- /dev/null
+++ b/crates/swc/tests/tsc-references/functionOverloadErrors_es2015.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | function fn1(x = 3);
+//! : ^^^^^
+//! `----
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 116 | function initExpr(n = 13);
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/functionOverloadErrors_es2015.2.minified.js b/crates/swc/tests/tsc-references/functionOverloadErrors_es2015.2.minified.js
new file mode 100644
index 000000000000..3747e6c0755b
--- /dev/null
+++ b/crates/swc/tests/tsc-references/functionOverloadErrors_es2015.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | function fn1(x = 3);
+//! : ^^^^^
+//! `----
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 116 | function initExpr(n = 13);
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/functionOverloadErrors_es5.1.normal.js b/crates/swc/tests/tsc-references/functionOverloadErrors_es5.1.normal.js
new file mode 100644
index 000000000000..3747e6c0755b
--- /dev/null
+++ b/crates/swc/tests/tsc-references/functionOverloadErrors_es5.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | function fn1(x = 3);
+//! : ^^^^^
+//! `----
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 116 | function initExpr(n = 13);
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/functionOverloadErrors_es5.2.minified.js b/crates/swc/tests/tsc-references/functionOverloadErrors_es5.2.minified.js
new file mode 100644
index 000000000000..3747e6c0755b
--- /dev/null
+++ b/crates/swc/tests/tsc-references/functionOverloadErrors_es5.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | function fn1(x = 3);
+//! : ^^^^^
+//! `----
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 116 | function initExpr(n = 13);
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck38_es2015.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck38_es2015.1.normal.js
new file mode 100644
index 000000000000..ece43a431147
--- /dev/null
+++ b/crates/swc/tests/tsc-references/generatorTypeCheck38_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | var yield;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck38_es2015.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck38_es2015.2.minified.js
new file mode 100644
index 000000000000..ece43a431147
--- /dev/null
+++ b/crates/swc/tests/tsc-references/generatorTypeCheck38_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | var yield;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck38_es5.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck38_es5.1.normal.js
new file mode 100644
index 000000000000..ece43a431147
--- /dev/null
+++ b/crates/swc/tests/tsc-references/generatorTypeCheck38_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | var yield;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck38_es5.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck38_es5.2.minified.js
new file mode 100644
index 000000000000..ece43a431147
--- /dev/null
+++ b/crates/swc/tests/tsc-references/generatorTypeCheck38_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | var yield;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/generic_es2015.1.normal.js b/crates/swc/tests/tsc-references/generic_es2015.1.normal.js
index a0798cddc67e..9ebdde4b3c38 100644
--- a/crates/swc/tests/tsc-references/generic_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/generic_es2015.1.normal.js
@@ -1,6 +1,7 @@
// @Filename: /a.ts
export class A {
}
+// @Filename: /b.ts
let a = {
a: ""
};
@@ -11,3 +12,4 @@ let c = {};
let d = {
a: ""
};
+export { };
diff --git a/crates/swc/tests/tsc-references/generic_es2015.2.minified.js b/crates/swc/tests/tsc-references/generic_es2015.2.minified.js
index 4a17f4af9fc7..95b1242eacaa 100644
--- a/crates/swc/tests/tsc-references/generic_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/generic_es2015.2.minified.js
@@ -1,2 +1,3 @@
export class A {
}
+export { };
diff --git a/crates/swc/tests/tsc-references/generic_es5.1.normal.js b/crates/swc/tests/tsc-references/generic_es5.1.normal.js
index c05326243b00..47a94abc4a53 100644
--- a/crates/swc/tests/tsc-references/generic_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/generic_es5.1.normal.js
@@ -4,6 +4,7 @@ export var A = function A() {
"use strict";
_class_call_check(this, A);
};
+// @Filename: /b.ts
var a = {
a: ""
};
@@ -14,3 +15,4 @@ var c = {};
var d = {
a: ""
};
+export { };
diff --git a/crates/swc/tests/tsc-references/generic_es5.2.minified.js b/crates/swc/tests/tsc-references/generic_es5.2.minified.js
index eed7ca896ebd..6845732041ee 100644
--- a/crates/swc/tests/tsc-references/generic_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/generic_es5.2.minified.js
@@ -3,3 +3,4 @@ export var A = function() {
"use strict";
_class_call_check(this, A);
};
+export { };
diff --git a/crates/swc/tests/tsc-references/globalThisVarDeclaration_es2015.2.minified.js b/crates/swc/tests/tsc-references/globalThisVarDeclaration_es2015.2.minified.js
index a90e68a45f03..06ccfa8302a6 100644
--- a/crates/swc/tests/tsc-references/globalThisVarDeclaration_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/globalThisVarDeclaration_es2015.2.minified.js
@@ -1 +1,2 @@
-this.a, this.b, self.a, self.b, window.a, window.b, top.a, top.b, this.a, this.b, self.a, self.b, window.a, window.b, top.a, top.b;
+this.a, this.b, self.a, self.b, window.a, window.b, top.a, top.b;
+this.a, this.b, self.a, self.b, window.a, window.b, top.a, top.b;
diff --git a/crates/swc/tests/tsc-references/globalThisVarDeclaration_es5.2.minified.js b/crates/swc/tests/tsc-references/globalThisVarDeclaration_es5.2.minified.js
index a90e68a45f03..06ccfa8302a6 100644
--- a/crates/swc/tests/tsc-references/globalThisVarDeclaration_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/globalThisVarDeclaration_es5.2.minified.js
@@ -1 +1,2 @@
-this.a, this.b, self.a, self.b, window.a, window.b, top.a, top.b, this.a, this.b, self.a, self.b, window.a, window.b, top.a, top.b;
+this.a, this.b, self.a, self.b, window.a, window.b, top.a, top.b;
+this.a, this.b, self.a, self.b, window.a, window.b, top.a, top.b;
diff --git a/crates/swc/tests/tsc-references/implementsClause_es2015.1.normal.js b/crates/swc/tests/tsc-references/implementsClause_es2015.1.normal.js
index e0f44220f5d8..8f3058c763d0 100644
--- a/crates/swc/tests/tsc-references/implementsClause_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/implementsClause_es2015.1.normal.js
@@ -1,4 +1,8 @@
// @Filename: types.ts
+export { };
+// @Filename: ns.ts
+export { };
+// @Filename: index.ts
class C {
}
class D {
diff --git a/crates/swc/tests/tsc-references/implementsClause_es2015.2.minified.js b/crates/swc/tests/tsc-references/implementsClause_es2015.2.minified.js
index 2234b9cae16d..f109f4c5600e 100644
--- a/crates/swc/tests/tsc-references/implementsClause_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/implementsClause_es2015.2.minified.js
@@ -1 +1,3 @@
export { };
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/implementsClause_es5.1.normal.js b/crates/swc/tests/tsc-references/implementsClause_es5.1.normal.js
index 56324d24685c..5d3916d9f541 100644
--- a/crates/swc/tests/tsc-references/implementsClause_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/implementsClause_es5.1.normal.js
@@ -1,4 +1,8 @@
// @Filename: types.ts
+export { };
+// @Filename: ns.ts
+export { };
+// @Filename: index.ts
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var C = function C() {
"use strict";
diff --git a/crates/swc/tests/tsc-references/implementsClause_es5.2.minified.js b/crates/swc/tests/tsc-references/implementsClause_es5.2.minified.js
index b1d9b8780f44..8970815a1c41 100644
--- a/crates/swc/tests/tsc-references/implementsClause_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/implementsClause_es5.2.minified.js
@@ -1,3 +1,5 @@
+export { };
+export { };
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var C = function() {
"use strict";
diff --git a/crates/swc/tests/tsc-references/importAssertion2_es2015.1.normal.js b/crates/swc/tests/tsc-references/importAssertion2_es2015.1.normal.js
index aad28f28f51b..1e987484dffa 100644
--- a/crates/swc/tests/tsc-references/importAssertion2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importAssertion2_es2015.1.normal.js
@@ -4,6 +4,7 @@
// @filename: 0.ts
export const a = 1;
export const b = 2;
+// @filename: 1.ts
export { a, b } from './0';
export * from './0';
import * as _ns from './0';
diff --git a/crates/swc/tests/tsc-references/importAssertion2_es2015.2.minified.js b/crates/swc/tests/tsc-references/importAssertion2_es2015.2.minified.js
index b121bbe0eb6a..3038348552be 100644
--- a/crates/swc/tests/tsc-references/importAssertion2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importAssertion2_es2015.2.minified.js
@@ -3,6 +3,6 @@ export const b = 2;
export { a, b } from './0';
export * from './0';
import * as _ns from './0';
+export { _ns as ns };
export { a, b } from './0';
export { a as c, b as d } from './0';
-export { _ns as ns };
diff --git a/crates/swc/tests/tsc-references/importAssertion2_es5.1.normal.js b/crates/swc/tests/tsc-references/importAssertion2_es5.1.normal.js
index aa962a7e8af9..385d30333fb7 100644
--- a/crates/swc/tests/tsc-references/importAssertion2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importAssertion2_es5.1.normal.js
@@ -4,6 +4,7 @@
// @filename: 0.ts
export var a = 1;
export var b = 2;
+// @filename: 1.ts
export { a, b } from "./0";
export * from "./0";
import * as _ns from "./0";
diff --git a/crates/swc/tests/tsc-references/importAssertion2_es5.2.minified.js b/crates/swc/tests/tsc-references/importAssertion2_es5.2.minified.js
index 173baa53f3cc..5872bbc24b9e 100644
--- a/crates/swc/tests/tsc-references/importAssertion2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importAssertion2_es5.2.minified.js
@@ -3,6 +3,6 @@ export var b = 2;
export { a, b } from "./0";
export * from "./0";
import * as _ns from "./0";
+export { _ns as ns };
export { a, b } from "./0";
export { a as c, b as d } from "./0";
-export { _ns as ns };
diff --git a/crates/swc/tests/tsc-references/importAssertion3_es2015.1.normal.js b/crates/swc/tests/tsc-references/importAssertion3_es2015.1.normal.js
index f3b38f158733..8999bb9ba0d9 100644
--- a/crates/swc/tests/tsc-references/importAssertion3_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importAssertion3_es2015.1.normal.js
@@ -3,3 +3,7 @@
// @module: es2015, esnext
// @filename: 0.ts
export { };
+// @filename: 1.ts
+export { };
+// @filename: 2.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/importAssertion3_es2015.2.minified.js b/crates/swc/tests/tsc-references/importAssertion3_es2015.2.minified.js
index 2234b9cae16d..f109f4c5600e 100644
--- a/crates/swc/tests/tsc-references/importAssertion3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importAssertion3_es2015.2.minified.js
@@ -1 +1,3 @@
export { };
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/importAssertion3_es5.1.normal.js b/crates/swc/tests/tsc-references/importAssertion3_es5.1.normal.js
index f3b38f158733..8999bb9ba0d9 100644
--- a/crates/swc/tests/tsc-references/importAssertion3_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importAssertion3_es5.1.normal.js
@@ -3,3 +3,7 @@
// @module: es2015, esnext
// @filename: 0.ts
export { };
+// @filename: 1.ts
+export { };
+// @filename: 2.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/importAssertion3_es5.2.minified.js b/crates/swc/tests/tsc-references/importAssertion3_es5.2.minified.js
index 2234b9cae16d..f109f4c5600e 100644
--- a/crates/swc/tests/tsc-references/importAssertion3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importAssertion3_es5.2.minified.js
@@ -1 +1,3 @@
export { };
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/importCallExpression3ES2020_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpression3ES2020_es2015.1.normal.js
index 06523ba96a59..5066222dc3c9 100644
--- a/crates/swc/tests/tsc-references/importCallExpression3ES2020_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpression3ES2020_es2015.1.normal.js
@@ -1,18 +1,18 @@
// @module: es2020
// @target: es2020
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
}
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: 2.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
class C extends (yield import("./0")).B {
}
var c = new C();
diff --git a/crates/swc/tests/tsc-references/importCallExpression3ES2020_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpression3ES2020_es2015.2.minified.js
index 911c1b8804f6..587ad9da14d3 100644
--- a/crates/swc/tests/tsc-references/importCallExpression3ES2020_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpression3ES2020_es2015.2.minified.js
@@ -1,9 +1,9 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
}
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function _foo() {
return (_foo = _async_to_generator(function*() {
class C extends (yield import("./0")).B {
diff --git a/crates/swc/tests/tsc-references/importCallExpression3ES2020_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpression3ES2020_es5.1.normal.js
index 7ce289e56409..d4aedb7dc44d 100644
--- a/crates/swc/tests/tsc-references/importCallExpression3ES2020_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpression3ES2020_es5.1.normal.js
@@ -1,11 +1,7 @@
// @module: es2020
// @target: es2020
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -17,12 +13,17 @@ export var B = /*#__PURE__*/ function() {
};
return B;
}();
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import regeneratorRuntime from "regenerator-runtime";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: 2.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
var C, c;
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
diff --git a/crates/swc/tests/tsc-references/importCallExpression3ES2020_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpression3ES2020_es5.2.minified.js
index 622553ec4998..27b173373359 100644
--- a/crates/swc/tests/tsc-references/importCallExpression3ES2020_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpression3ES2020_es5.2.minified.js
@@ -1,8 +1,4 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = function() {
"use strict";
function B() {
@@ -12,6 +8,11 @@ export var B = function() {
return "I am B";
}, B;
}();
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import regeneratorRuntime from "regenerator-runtime";
function _foo() {
return (_foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
var C, c;
diff --git a/crates/swc/tests/tsc-references/importCallExpression4ES2020_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpression4ES2020_es2015.1.normal.js
index 20dd1d486fb8..47d895e7e945 100644
--- a/crates/swc/tests/tsc-references/importCallExpression4ES2020_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpression4ES2020_es2015.1.normal.js
@@ -2,7 +2,6 @@
// @module: es2020
// @target: es2020
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
@@ -15,6 +14,8 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
class C {
method() {
const loadAsync = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpression4ES2020_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpression4ES2020_es2015.2.minified.js
index 3eb198ed5934..2e1781f4286f 100644
--- a/crates/swc/tests/tsc-references/importCallExpression4ES2020_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpression4ES2020_es2015.2.minified.js
@@ -1,4 +1,3 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
@@ -10,3 +9,4 @@ export function foo() {
export function backup() {
return "backup";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.1.normal.js
index 0c56d770e70e..b507d5e59866 100644
--- a/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.1.normal.js
@@ -2,9 +2,7 @@
// @module: es2020
// @target: es2020
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -23,6 +21,10 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import regeneratorRuntime from "regenerator-runtime";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
diff --git a/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.2.minified.js
index 940b5e30ea9c..197709aa2345 100644
--- a/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpression4ES2020_es5.2.minified.js
@@ -1,6 +1,4 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = function() {
"use strict";
function B() {
@@ -16,6 +14,9 @@ export function foo() {
export function backup() {
return "backup";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import regeneratorRuntime from "regenerator-runtime";
var C = function() {
"use strict";
function C() {
diff --git a/crates/swc/tests/tsc-references/importCallExpression5ES2020_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpression5ES2020_es2015.1.normal.js
index a0ff0617e190..ebd584b07099 100644
--- a/crates/swc/tests/tsc-references/importCallExpression5ES2020_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpression5ES2020_es2015.1.normal.js
@@ -14,6 +14,7 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
const specify = bar() ? "./0" : undefined;
let myModule = import(specify);
let myModule1 = import(undefined);
diff --git a/crates/swc/tests/tsc-references/importCallExpression5ES2020_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpression5ES2020_es2015.2.minified.js
index af5f0fd430fb..dcd65150bab3 100644
--- a/crates/swc/tests/tsc-references/importCallExpression5ES2020_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpression5ES2020_es2015.2.minified.js
@@ -9,5 +9,5 @@ export function foo() {
export function backup() {
return "backup";
}
-let specify = bar() ? "./0" : void 0;
+const specify = bar() ? "./0" : void 0;
import(specify), import(void 0), import(bar() ? "./1" : null), import(null);
diff --git a/crates/swc/tests/tsc-references/importCallExpression5ES2020_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpression5ES2020_es5.1.normal.js
index 1bac260f9693..eaf50c8d4d69 100644
--- a/crates/swc/tests/tsc-references/importCallExpression5ES2020_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpression5ES2020_es5.1.normal.js
@@ -21,6 +21,7 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
var specify = bar() ? "./0" : undefined;
var myModule = import(specify);
var myModule1 = import(undefined);
diff --git a/crates/swc/tests/tsc-references/importCallExpression6ES2020_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpression6ES2020_es2015.1.normal.js
index e468c98cadcf..8d33a3238df8 100644
--- a/crates/swc/tests/tsc-references/importCallExpression6ES2020_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpression6ES2020_es2015.1.normal.js
@@ -13,6 +13,7 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
const specify = bar() ? "./0" : undefined;
let myModule = import(specify);
let myModule1 = import(undefined);
diff --git a/crates/swc/tests/tsc-references/importCallExpression6ES2020_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpression6ES2020_es2015.2.minified.js
index af5f0fd430fb..dcd65150bab3 100644
--- a/crates/swc/tests/tsc-references/importCallExpression6ES2020_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpression6ES2020_es2015.2.minified.js
@@ -9,5 +9,5 @@ export function foo() {
export function backup() {
return "backup";
}
-let specify = bar() ? "./0" : void 0;
+const specify = bar() ? "./0" : void 0;
import(specify), import(void 0), import(bar() ? "./1" : null), import(null);
diff --git a/crates/swc/tests/tsc-references/importCallExpression6ES2020_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpression6ES2020_es5.1.normal.js
index 34e5356c648b..935feafc7427 100644
--- a/crates/swc/tests/tsc-references/importCallExpression6ES2020_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpression6ES2020_es5.1.normal.js
@@ -20,6 +20,7 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
var specify = bar() ? "./0" : undefined;
var myModule = import(specify);
var myModule1 = import(undefined);
diff --git a/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es2015.1.normal.js
index de62ad3f4430..682bb89538ff 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es2015.1.normal.js
@@ -7,6 +7,8 @@ export class D {
// @filename: defaultPath.ts
export class C {
}
+// @filename: 1.ts
let p1 = import("./defaultPath");
let p2 = import("./defaultPath");
let p3 = import("./defaultPath");
+export { };
diff --git a/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es2015.2.minified.js
index f84d920d95a6..e6bd82862e55 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es2015.2.minified.js
@@ -3,3 +3,4 @@ export class D {
export class C {
}
import("./defaultPath"), import("./defaultPath"), import("./defaultPath");
+export { };
diff --git a/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es5.1.normal.js
index a50567b652bc..b9df7ab08e5f 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es5.1.normal.js
@@ -8,10 +8,13 @@ export var D = function D() {
_class_call_check(this, D);
};
// @filename: defaultPath.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var C = function C() {
"use strict";
_class_call_check(this, C);
};
+// @filename: 1.ts
var p1 = import("./defaultPath");
var p2 = import("./defaultPath");
var p3 = import("./defaultPath");
+export { };
diff --git a/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es5.2.minified.js
index 622c684b1c91..af9cf3587b3b 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionCheckReturntype1_es5.2.minified.js
@@ -3,8 +3,10 @@ export var D = function() {
"use strict";
_class_call_check(this, D);
};
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var C = function() {
"use strict";
_class_call_check(this, C);
};
import("./defaultPath"), import("./defaultPath"), import("./defaultPath");
+export { };
diff --git a/crates/swc/tests/tsc-references/importCallExpressionDeclarationEmit3_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionDeclarationEmit3_es2015.1.normal.js
index 1feea8e2e53e..25234b15011f 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionDeclarationEmit3_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionDeclarationEmit3_es2015.1.normal.js
@@ -5,6 +5,7 @@
export function foo() {
return "foo";
}
+// @filename: 1.ts
import("./0");
export var p0 = import(getPath());
export var p1 = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionDeclarationEmit3_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionDeclarationEmit3_es5.1.normal.js
index 1feea8e2e53e..25234b15011f 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionDeclarationEmit3_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionDeclarationEmit3_es5.1.normal.js
@@ -5,6 +5,7 @@
export function foo() {
return "foo";
}
+// @filename: 1.ts
import("./0");
export var p0 = import(getPath());
export var p1 = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES5AMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionES5AMD_es5.1.normal.js
index 6c45ce795c32..97ba5415420a 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES5AMD_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES5AMD_es5.1.normal.js
@@ -2,12 +2,12 @@
// @target: es5
// @lib: es6
// @filename: 0.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
// @filename: 1.ts
import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var p1 = import("./0");
p1.then(function(zero) {
return zero.foo();
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES5AMD_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionES5AMD_es5.2.minified.js
index ce0188bae2aa..f80e0190a3eb 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES5AMD_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES5AMD_es5.2.minified.js
@@ -1,8 +1,9 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
-import("./0"), import("./0").then(function(zero) {
+import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import("./0").then(function(zero) {
return zero.foo();
});
export var p2 = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES5CJS_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionES5CJS_es5.1.normal.js
index e60e3ce85e60..8a8fde469365 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES5CJS_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES5CJS_es5.1.normal.js
@@ -2,12 +2,12 @@
// @target: es5
// @lib: es6
// @filename: 0.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
// @filename: 1.ts
import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var p1 = import("./0");
p1.then(function(zero) {
return zero.foo();
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES5CJS_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionES5CJS_es5.2.minified.js
index ce0188bae2aa..f80e0190a3eb 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES5CJS_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES5CJS_es5.2.minified.js
@@ -1,8 +1,9 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
-import("./0"), import("./0").then(function(zero) {
+import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import("./0").then(function(zero) {
return zero.foo();
});
export var p2 = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES5System_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionES5System_es5.1.normal.js
index f1c027a60b69..3e77dddbcf65 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES5System_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES5System_es5.1.normal.js
@@ -2,12 +2,12 @@
// @target: es5
// @lib: es6
// @filename: 0.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
// @filename: 1.ts
import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var p1 = import("./0");
p1.then(function(zero) {
return zero.foo();
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES5System_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionES5System_es5.2.minified.js
index ce0188bae2aa..f80e0190a3eb 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES5System_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES5System_es5.2.minified.js
@@ -1,8 +1,9 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
-import("./0"), import("./0").then(function(zero) {
+import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import("./0").then(function(zero) {
return zero.foo();
});
export var p2 = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES5UMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionES5UMD_es5.1.normal.js
index 548df485eda0..ed27672f5892 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES5UMD_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES5UMD_es5.1.normal.js
@@ -2,12 +2,12 @@
// @target: es5
// @lib: es6
// @filename: 0.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
// @filename: 1.ts
import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var p1 = import("./0");
p1.then(function(zero) {
return zero.foo();
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES5UMD_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionES5UMD_es5.2.minified.js
index ce0188bae2aa..f80e0190a3eb 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES5UMD_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES5UMD_es5.2.minified.js
@@ -1,8 +1,9 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
-import("./0"), import("./0").then(function(zero) {
+import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import("./0").then(function(zero) {
return zero.foo();
});
export var p2 = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES6AMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionES6AMD_es5.1.normal.js
index 0b17219eb837..ecb1e5eec592 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES6AMD_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES6AMD_es5.1.normal.js
@@ -1,12 +1,12 @@
// @module: amd
// @target: es6
// @filename: 0.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
// @filename: 1.ts
import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var p1 = import("./0");
p1.then(function(zero) {
return zero.foo();
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES6AMD_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionES6AMD_es5.2.minified.js
index ce0188bae2aa..f80e0190a3eb 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES6AMD_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES6AMD_es5.2.minified.js
@@ -1,8 +1,9 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
-import("./0"), import("./0").then(function(zero) {
+import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import("./0").then(function(zero) {
return zero.foo();
});
export var p2 = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES6CJS_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionES6CJS_es5.1.normal.js
index a47678622025..c55abf577856 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES6CJS_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES6CJS_es5.1.normal.js
@@ -1,12 +1,12 @@
// @module: commonjs
// @target: es6
// @filename: 0.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
// @filename: 1.ts
import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var p1 = import("./0");
p1.then(function(zero) {
return zero.foo();
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES6CJS_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionES6CJS_es5.2.minified.js
index ce0188bae2aa..f80e0190a3eb 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES6CJS_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES6CJS_es5.2.minified.js
@@ -1,8 +1,9 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
-import("./0"), import("./0").then(function(zero) {
+import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import("./0").then(function(zero) {
return zero.foo();
});
export var p2 = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES6System_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionES6System_es5.1.normal.js
index 9f27ef3b640a..908c6098177f 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES6System_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES6System_es5.1.normal.js
@@ -1,12 +1,12 @@
// @module: system
// @target: es6
// @filename: 0.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
// @filename: 1.ts
import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var p1 = import("./0");
p1.then(function(zero) {
return zero.foo();
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES6System_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionES6System_es5.2.minified.js
index ce0188bae2aa..f80e0190a3eb 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES6System_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES6System_es5.2.minified.js
@@ -1,8 +1,9 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
-import("./0"), import("./0").then(function(zero) {
+import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import("./0").then(function(zero) {
return zero.foo();
});
export var p2 = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES6UMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionES6UMD_es5.1.normal.js
index 7cf647247b7b..6861fe0e711c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES6UMD_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES6UMD_es5.1.normal.js
@@ -1,12 +1,12 @@
// @module: umd
// @target: es6
// @filename: 0.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
// @filename: 1.ts
import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var p1 = import("./0");
p1.then(function(zero) {
return zero.foo();
diff --git a/crates/swc/tests/tsc-references/importCallExpressionES6UMD_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionES6UMD_es5.2.minified.js
index ce0188bae2aa..f80e0190a3eb 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionES6UMD_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionES6UMD_es5.2.minified.js
@@ -1,8 +1,9 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export function foo() {
return "foo";
}
-import("./0"), import("./0").then(function(zero) {
+import("./0");
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import("./0").then(function(zero) {
return zero.foo();
});
export var p2 = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es2015.1.normal.js
index 83383177cf5e..6ed84a52de65 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es2015.1.normal.js
@@ -1,18 +1,18 @@
// @module: amd
// @target: esnext
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
}
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: 2.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
class C extends (yield import("./0")).B {
}
var c = new C();
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es2015.2.minified.js
index 911c1b8804f6..587ad9da14d3 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es2015.2.minified.js
@@ -1,9 +1,9 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
}
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function _foo() {
return (_foo = _async_to_generator(function*() {
class C extends (yield import("./0")).B {
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es5.1.normal.js
index a0b7bba50e68..244d61e144d7 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es5.1.normal.js
@@ -1,11 +1,7 @@
// @module: amd
// @target: esnext
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -17,12 +13,17 @@ export var B = /*#__PURE__*/ function() {
};
return B;
}();
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import regeneratorRuntime from "regenerator-runtime";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: 2.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
var C, c;
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es5.2.minified.js
index 622553ec4998..27b173373359 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInAMD3_es5.2.minified.js
@@ -1,8 +1,4 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = function() {
"use strict";
function B() {
@@ -12,6 +8,11 @@ export var B = function() {
return "I am B";
}, B;
}();
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import regeneratorRuntime from "regenerator-runtime";
function _foo() {
return (_foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
var C, c;
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es2015.1.normal.js
index 0f56bdec7ccd..c692817802a5 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es2015.1.normal.js
@@ -2,7 +2,6 @@
// @target: esnext
// @useDefineForClassFields: false
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
@@ -15,6 +14,8 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
class C {
method() {
const loadAsync = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es2015.2.minified.js
index 6ad9c76ea695..5ef9cdfc4cab 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es2015.2.minified.js
@@ -1,4 +1,3 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
@@ -10,6 +9,7 @@ export function foo() {
export function backup() {
return "backup";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class D {
method() {
var _ref;
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.1.normal.js
index f8880d6b0b80..5c45b04c7f3a 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.1.normal.js
@@ -2,9 +2,7 @@
// @target: esnext
// @useDefineForClassFields: false
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -23,6 +21,10 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import regeneratorRuntime from "regenerator-runtime";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.2.minified.js
index 11f5eb40acf7..e3d755642f78 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInAMD4_es5.2.minified.js
@@ -1,6 +1,4 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = function() {
"use strict";
function B() {
@@ -16,6 +14,9 @@ export function foo() {
export function backup() {
return "backup";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import regeneratorRuntime from "regenerator-runtime";
var C = function() {
"use strict";
function C() {
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es2015.1.normal.js
index 5a2efd71aa15..362804183c0d 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es2015.1.normal.js
@@ -1,7 +1,6 @@
// @module: commonjs
// @target: esnext
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export function foo() {
return "foo";
}
@@ -9,12 +8,13 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function compute(promise) {
return _compute.apply(this, arguments);
}
function _compute() {
- _compute = // @filename: 2.ts
- _async_to_generator(function*(promise) {
+ _compute = _async_to_generator(function*(promise) {
let j = yield promise;
if (!j) {
j = yield import("./1");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es2015.2.minified.js
index 097948c88403..3722b67c8f0b 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es2015.2.minified.js
@@ -1,10 +1,10 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export function foo() {
return "foo";
}
export function backup() {
return "backup";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function _compute() {
return (_compute = _async_to_generator(function*(promise) {
let j = yield promise;
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es5.1.normal.js
index 216fba66ec18..092434018b3c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es5.1.normal.js
@@ -1,8 +1,6 @@
// @module: commonjs
// @target: esnext
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export function foo() {
return "foo";
}
@@ -10,12 +8,14 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import regeneratorRuntime from "regenerator-runtime";
function compute(promise) {
return _compute.apply(this, arguments);
}
function _compute() {
- _compute = // @filename: 2.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee(promise) {
+ _compute = _async_to_generator(regeneratorRuntime.mark(function _callee(promise) {
var j;
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es5.2.minified.js
index df921408d9cb..9066ab713fea 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS2_es5.2.minified.js
@@ -1,11 +1,11 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export function foo() {
return "foo";
}
export function backup() {
return "backup";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import regeneratorRuntime from "regenerator-runtime";
function _compute() {
return (_compute = _async_to_generator(regeneratorRuntime.mark(function _callee(promise) {
var j;
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es2015.1.normal.js
index debd6de8fc62..30c1140406ea 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es2015.1.normal.js
@@ -1,18 +1,18 @@
// @module: commonjs
// @target: esnext
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
}
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: 2.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
class C extends (yield import("./0")).B {
}
var c = new C();
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es2015.2.minified.js
index 911c1b8804f6..587ad9da14d3 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es2015.2.minified.js
@@ -1,9 +1,9 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
}
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function _foo() {
return (_foo = _async_to_generator(function*() {
class C extends (yield import("./0")).B {
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es5.1.normal.js
index d5b034c9613f..2e5d854f91e6 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es5.1.normal.js
@@ -1,11 +1,7 @@
// @module: commonjs
// @target: esnext
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -17,12 +13,17 @@ export var B = /*#__PURE__*/ function() {
};
return B;
}();
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import regeneratorRuntime from "regenerator-runtime";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: 2.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
var C, c;
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es5.2.minified.js
index 622553ec4998..27b173373359 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS4_es5.2.minified.js
@@ -1,8 +1,4 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = function() {
"use strict";
function B() {
@@ -12,6 +8,11 @@ export var B = function() {
return "I am B";
}, B;
}();
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import regeneratorRuntime from "regenerator-runtime";
function _foo() {
return (_foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
var C, c;
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es2015.1.normal.js
index 07a02803a38d..d233fb2bfed4 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es2015.1.normal.js
@@ -2,7 +2,6 @@
// @target: esnext
// @useDefineForClassFields: false
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
@@ -15,6 +14,8 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
class C {
method() {
const loadAsync = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es2015.2.minified.js
index 6ad9c76ea695..5ef9cdfc4cab 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es2015.2.minified.js
@@ -1,4 +1,3 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
@@ -10,6 +9,7 @@ export function foo() {
export function backup() {
return "backup";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class D {
method() {
var _ref;
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.1.normal.js
index 664f20c104f1..fd4780abf88e 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.1.normal.js
@@ -2,9 +2,7 @@
// @target: esnext
// @useDefineForClassFields: false
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -23,6 +21,10 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import regeneratorRuntime from "regenerator-runtime";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.2.minified.js
index 11f5eb40acf7..e3d755642f78 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInCJS5_es5.2.minified.js
@@ -1,6 +1,4 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = function() {
"use strict";
function B() {
@@ -16,6 +14,9 @@ export function foo() {
export function backup() {
return "backup";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import regeneratorRuntime from "regenerator-runtime";
var C = function() {
"use strict";
function C() {
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es2015.1.normal.js
index 775ef0367b4d..e04cd5894bcd 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es2015.1.normal.js
@@ -3,3 +3,9 @@
// @filename: something.ts
module.exports = 42;
export { };
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+module.exports = _async_to_generator(function*() {
+ const something = yield import("./something");
+});
+export { };
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es2015.2.minified.js
index d8b61fd48f4b..deaf15d21ede 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es2015.2.minified.js
@@ -1,2 +1,6 @@
module.exports = 42;
export { };
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+module.exports = _async_to_generator(function*() {
+ yield import("./something");
+});
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es5.1.normal.js
index 775ef0367b4d..d0d229e6a52f 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es5.1.normal.js
@@ -3,3 +3,22 @@
// @filename: something.ts
module.exports = 42;
export { };
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import regeneratorRuntime from "regenerator-runtime";
+module.exports = _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ var something;
+ return regeneratorRuntime.wrap(function _callee$(_ctx) {
+ while(1)switch(_ctx.prev = _ctx.next){
+ case 0:
+ _ctx.next = 2;
+ return import("./something");
+ case 2:
+ something = _ctx.sent;
+ case 3:
+ case "end":
+ return _ctx.stop();
+ }
+ }, _callee);
+}));
+export { };
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es5.2.minified.js
index d8b61fd48f4b..7655076e7321 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsAMD_es5.2.minified.js
@@ -1,2 +1,18 @@
module.exports = 42;
export { };
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import regeneratorRuntime from "regenerator-runtime";
+module.exports = _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ var something;
+ return regeneratorRuntime.wrap(function(_ctx) {
+ for(;;)switch(_ctx.prev = _ctx.next){
+ case 0:
+ return _ctx.next = 2, import("./something");
+ case 2:
+ something = _ctx.sent;
+ case 3:
+ case "end":
+ return _ctx.stop();
+ }
+ }, _callee);
+}));
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es2015.1.normal.js
index 8748fccf8f58..6422c9be9363 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es2015.1.normal.js
@@ -3,3 +3,9 @@
// @filename: something.ts
module.exports = 42;
export { };
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+module.exports = _async_to_generator(function*() {
+ const something = yield import("./something");
+});
+export { };
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es2015.2.minified.js
index d8b61fd48f4b..deaf15d21ede 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es2015.2.minified.js
@@ -1,2 +1,6 @@
module.exports = 42;
export { };
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+module.exports = _async_to_generator(function*() {
+ yield import("./something");
+});
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es5.1.normal.js
index 8748fccf8f58..5991266b90c8 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es5.1.normal.js
@@ -3,3 +3,22 @@
// @filename: something.ts
module.exports = 42;
export { };
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import regeneratorRuntime from "regenerator-runtime";
+module.exports = _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ var something;
+ return regeneratorRuntime.wrap(function _callee$(_ctx) {
+ while(1)switch(_ctx.prev = _ctx.next){
+ case 0:
+ _ctx.next = 2;
+ return import("./something");
+ case 2:
+ something = _ctx.sent;
+ case 3:
+ case "end":
+ return _ctx.stop();
+ }
+ }, _callee);
+}));
+export { };
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es5.2.minified.js
index d8b61fd48f4b..7655076e7321 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsCJS_es5.2.minified.js
@@ -1,2 +1,18 @@
module.exports = 42;
export { };
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import regeneratorRuntime from "regenerator-runtime";
+module.exports = _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ var something;
+ return regeneratorRuntime.wrap(function(_ctx) {
+ for(;;)switch(_ctx.prev = _ctx.next){
+ case 0:
+ return _ctx.next = 2, import("./something");
+ case 2:
+ something = _ctx.sent;
+ case 3:
+ case "end":
+ return _ctx.stop();
+ }
+ }, _callee);
+}));
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es2015.1.normal.js
index 984d52d0f066..507b6349d536 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es2015.1.normal.js
@@ -3,3 +3,9 @@
// @filename: something.ts
module.exports = 42;
export { };
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+module.exports = _async_to_generator(function*() {
+ const something = yield import("./something");
+});
+export { };
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es2015.2.minified.js
index d8b61fd48f4b..deaf15d21ede 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es2015.2.minified.js
@@ -1,2 +1,6 @@
module.exports = 42;
export { };
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+module.exports = _async_to_generator(function*() {
+ yield import("./something");
+});
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es5.1.normal.js
index 984d52d0f066..f39fe9c8fa2e 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es5.1.normal.js
@@ -3,3 +3,22 @@
// @filename: something.ts
module.exports = 42;
export { };
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import regeneratorRuntime from "regenerator-runtime";
+module.exports = _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ var something;
+ return regeneratorRuntime.wrap(function _callee$(_ctx) {
+ while(1)switch(_ctx.prev = _ctx.next){
+ case 0:
+ _ctx.next = 2;
+ return import("./something");
+ case 2:
+ something = _ctx.sent;
+ case 3:
+ case "end":
+ return _ctx.stop();
+ }
+ }, _callee);
+}));
+export { };
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es5.2.minified.js
index d8b61fd48f4b..7655076e7321 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInExportEqualsUMD_es5.2.minified.js
@@ -1,2 +1,18 @@
module.exports = 42;
export { };
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import regeneratorRuntime from "regenerator-runtime";
+module.exports = _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ var something;
+ return regeneratorRuntime.wrap(function(_ctx) {
+ for(;;)switch(_ctx.prev = _ctx.next){
+ case 0:
+ return _ctx.next = 2, import("./something");
+ case 2:
+ something = _ctx.sent;
+ case 3:
+ case "end":
+ return _ctx.stop();
+ }
+ }, _callee);
+}));
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es2015.1.normal.js
index 8f38023aaea8..fd1f32e04c37 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es2015.1.normal.js
@@ -1,18 +1,18 @@
// @module: system
// @target: esnext
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
}
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: 2.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
class C extends (yield import("./0")).B {
}
var c = new C();
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es2015.2.minified.js
index 911c1b8804f6..587ad9da14d3 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es2015.2.minified.js
@@ -1,9 +1,9 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
}
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function _foo() {
return (_foo = _async_to_generator(function*() {
class C extends (yield import("./0")).B {
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es5.1.normal.js
index 6e16063efc78..586ced3e69ba 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es5.1.normal.js
@@ -1,11 +1,7 @@
// @module: system
// @target: esnext
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -17,12 +13,17 @@ export var B = /*#__PURE__*/ function() {
};
return B;
}();
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import regeneratorRuntime from "regenerator-runtime";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: 2.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
var C, c;
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es5.2.minified.js
index 622553ec4998..27b173373359 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInSystem3_es5.2.minified.js
@@ -1,8 +1,4 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = function() {
"use strict";
function B() {
@@ -12,6 +8,11 @@ export var B = function() {
return "I am B";
}, B;
}();
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import regeneratorRuntime from "regenerator-runtime";
function _foo() {
return (_foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
var C, c;
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es2015.1.normal.js
index 3dc260f80811..5e2323943ce1 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es2015.1.normal.js
@@ -2,7 +2,6 @@
// @target: esnext
// @useDefineForClassFields: false
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
@@ -15,6 +14,8 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
class C {
method() {
const loadAsync = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es2015.2.minified.js
index 6ad9c76ea695..5ef9cdfc4cab 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es2015.2.minified.js
@@ -1,4 +1,3 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
@@ -10,6 +9,7 @@ export function foo() {
export function backup() {
return "backup";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class D {
method() {
var _ref;
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.1.normal.js
index 23dd20fbe2cb..dc7e667d7811 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.1.normal.js
@@ -2,9 +2,7 @@
// @target: esnext
// @useDefineForClassFields: false
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -23,6 +21,10 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import regeneratorRuntime from "regenerator-runtime";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.2.minified.js
index 11f5eb40acf7..e3d755642f78 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInSystem4_es5.2.minified.js
@@ -1,6 +1,4 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = function() {
"use strict";
function B() {
@@ -16,6 +14,9 @@ export function foo() {
export function backup() {
return "backup";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import regeneratorRuntime from "regenerator-runtime";
var C = function() {
"use strict";
function C() {
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es2015.1.normal.js
index e8b5f50fa805..b79f6ba92965 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es2015.1.normal.js
@@ -1,18 +1,18 @@
// @module: umd
// @target: esnext
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
}
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: 2.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
class C extends (yield import("./0")).B {
}
var c = new C();
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es2015.2.minified.js
index 911c1b8804f6..587ad9da14d3 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es2015.2.minified.js
@@ -1,9 +1,9 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
}
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function _foo() {
return (_foo = _async_to_generator(function*() {
class C extends (yield import("./0")).B {
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es5.1.normal.js
index c259b2bb698b..655973448375 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es5.1.normal.js
@@ -1,11 +1,7 @@
// @module: umd
// @target: esnext
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -17,12 +13,17 @@ export var B = /*#__PURE__*/ function() {
};
return B;
}();
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import regeneratorRuntime from "regenerator-runtime";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: 2.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
var C, c;
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es5.2.minified.js
index 622553ec4998..27b173373359 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD3_es5.2.minified.js
@@ -1,8 +1,4 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = function() {
"use strict";
function B() {
@@ -12,6 +8,11 @@ export var B = function() {
return "I am B";
}, B;
}();
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import regeneratorRuntime from "regenerator-runtime";
function _foo() {
return (_foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
var C, c;
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es2015.1.normal.js
index fc4df8751f6e..2325fffafa11 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es2015.1.normal.js
@@ -2,7 +2,6 @@
// @target: esnext
// @useDefineForClassFields: false
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
@@ -15,6 +14,8 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
class C {
method() {
const loadAsync = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es2015.2.minified.js
index 6ad9c76ea695..5ef9cdfc4cab 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es2015.2.minified.js
@@ -1,4 +1,3 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
@@ -10,6 +9,7 @@ export function foo() {
export function backup() {
return "backup";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class D {
method() {
var _ref;
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.1.normal.js
index 41938e3c6bab..8161591baa55 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.1.normal.js
@@ -2,9 +2,7 @@
// @target: esnext
// @useDefineForClassFields: false
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -23,6 +21,10 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import regeneratorRuntime from "regenerator-runtime";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.2.minified.js
index 11f5eb40acf7..e3d755642f78 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD4_es5.2.minified.js
@@ -1,6 +1,4 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = function() {
"use strict";
function B() {
@@ -16,6 +14,9 @@ export function foo() {
export function backup() {
return "backup";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import regeneratorRuntime from "regenerator-runtime";
var C = function() {
"use strict";
function C() {
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es2015.1.normal.js
index 1483dd82ace4..c532af7ef3ed 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es2015.1.normal.js
@@ -1,17 +1,17 @@
// @module: umd
// @target: es2015
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export function foo() {
return "foo";
}
+// @filename: 1.ts
+// https://github.com/microsoft/TypeScript/issues/36780
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function func() {
return _func.apply(this, arguments);
}
function _func() {
- _func = // @filename: 1.ts
- // https://github.com/microsoft/TypeScript/issues/36780
- _async_to_generator(function*() {
+ _func = _async_to_generator(function*() {
const packageName = '.';
const packageJson = yield import(packageName + '/package.json');
});
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es2015.2.minified.js
index d34b692697bb..c1637f2b41b6 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es2015.2.minified.js
@@ -1,4 +1,4 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export function foo() {
return "foo";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es5.1.normal.js
index 44a6030fa484..c20d640f6428 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es5.1.normal.js
@@ -1,18 +1,18 @@
// @module: umd
// @target: es2015
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export function foo() {
return "foo";
}
+// @filename: 1.ts
+// https://github.com/microsoft/TypeScript/issues/36780
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import regeneratorRuntime from "regenerator-runtime";
function func() {
return _func.apply(this, arguments);
}
function _func() {
- _func = // @filename: 1.ts
- // https://github.com/microsoft/TypeScript/issues/36780
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _func = _async_to_generator(regeneratorRuntime.mark(function _callee() {
var packageName, packageJson;
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
diff --git a/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es5.2.minified.js
index a018f80a76aa..7cfcc256f61c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionInUMD5_es5.2.minified.js
@@ -1,5 +1,5 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export function foo() {
return "foo";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import regeneratorRuntime from "regenerator-runtime";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es2015.1.normal.js
index 4f075319b534..8109c71f2d7c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es2015.1.normal.js
@@ -3,14 +3,14 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
return yield import((yield import("./foo")).default);
});
return _foo.apply(this, arguments);
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es2015.2.minified.js
index cf78ab1856e1..660bcb029f55 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es2015.2.minified.js
@@ -1,2 +1,2 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es5.1.normal.js
index c46f6882fb1a..10c3fac3b8c8 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es5.1.normal.js
@@ -3,15 +3,15 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
+export default "./foo";
+// @filename: index.ts
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es5.2.minified.js
index a7609b071a23..cf8ad2fce58c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD2_es5.2.minified.js
@@ -1,3 +1,3 @@
+export default "./foo";
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es2015.1.normal.js
index 24805da2d4bd..a99eeee57312 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es2015.1.normal.js
@@ -3,14 +3,14 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
return yield import((yield import("./foo")).default);
});
return _foo.apply(this, arguments);
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es2015.2.minified.js
index cf78ab1856e1..660bcb029f55 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es2015.2.minified.js
@@ -1,2 +1,2 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es5.1.normal.js
index a5c9b3631c59..a86847cb51c3 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es5.1.normal.js
@@ -3,15 +3,15 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
+export default "./foo";
+// @filename: index.ts
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es5.2.minified.js
index a7609b071a23..cf8ad2fce58c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedAMD_es5.2.minified.js
@@ -1,3 +1,3 @@
+export default "./foo";
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es2015.1.normal.js
index 5762cc4e81b4..84a5a96f7c6c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es2015.1.normal.js
@@ -3,14 +3,14 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
return yield import((yield import("./foo")).default);
});
return _foo.apply(this, arguments);
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es2015.2.minified.js
index cf78ab1856e1..660bcb029f55 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es2015.2.minified.js
@@ -1,2 +1,2 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es5.1.normal.js
index 4a80794970e5..e22db33d4ed1 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es5.1.normal.js
@@ -3,15 +3,15 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
+export default "./foo";
+// @filename: index.ts
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es5.2.minified.js
index a7609b071a23..cf8ad2fce58c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS2_es5.2.minified.js
@@ -1,3 +1,3 @@
+export default "./foo";
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es2015.1.normal.js
index 604eb03a5b53..cd0b416d597d 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es2015.1.normal.js
@@ -3,14 +3,14 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
return yield import((yield import("./foo")).default);
});
return _foo.apply(this, arguments);
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es2015.2.minified.js
index cf78ab1856e1..660bcb029f55 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es2015.2.minified.js
@@ -1,2 +1,2 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es5.1.normal.js
index 90dc29f083ce..11151d6c9e46 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es5.1.normal.js
@@ -3,15 +3,15 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
+export default "./foo";
+// @filename: index.ts
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es5.2.minified.js
index a7609b071a23..cf8ad2fce58c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedCJS_es5.2.minified.js
@@ -1,3 +1,3 @@
+export default "./foo";
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es2015.1.normal.js
index 593177a9d782..cd43cd57c254 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es2015.1.normal.js
@@ -3,14 +3,14 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
return yield import((yield import("./foo")).default);
});
return _foo.apply(this, arguments);
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es2015.2.minified.js
index cf78ab1856e1..660bcb029f55 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es2015.2.minified.js
@@ -1,2 +1,2 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es5.1.normal.js
index 5ec9020ed8f7..f353106d9d84 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es5.1.normal.js
@@ -3,15 +3,15 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
+export default "./foo";
+// @filename: index.ts
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es5.2.minified.js
index a7609b071a23..cf8ad2fce58c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES20152_es5.2.minified.js
@@ -1,3 +1,3 @@
+export default "./foo";
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es2015.1.normal.js
index 210c5c471101..6f14ef8bf463 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es2015.1.normal.js
@@ -3,14 +3,14 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
return yield import((yield import("./foo")).default);
});
return _foo.apply(this, arguments);
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es2015.2.minified.js
index cf78ab1856e1..660bcb029f55 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es2015.2.minified.js
@@ -1,2 +1,2 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es5.1.normal.js
index 81cfa2d2caaa..46f12fb39df6 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es5.1.normal.js
@@ -3,15 +3,15 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
+export default "./foo";
+// @filename: index.ts
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es5.2.minified.js
index a7609b071a23..cf8ad2fce58c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES2015_es5.2.minified.js
@@ -1,3 +1,3 @@
+export default "./foo";
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es2015.1.normal.js
index ee56587c2e07..dfcff0eac082 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es2015.1.normal.js
@@ -3,14 +3,14 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
return yield import((yield import("./foo")).default);
});
return _foo.apply(this, arguments);
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es2015.2.minified.js
index cf78ab1856e1..660bcb029f55 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es2015.2.minified.js
@@ -1,2 +1,2 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es5.1.normal.js
index acb58253d0a9..762832b4807e 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es5.1.normal.js
@@ -3,15 +3,15 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
+export default "./foo";
+// @filename: index.ts
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es5.2.minified.js
index a7609b071a23..cf8ad2fce58c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES20202_es5.2.minified.js
@@ -1,3 +1,3 @@
+export default "./foo";
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es2015.1.normal.js
index 11c2e913b4f9..6ce6bb4f0dad 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es2015.1.normal.js
@@ -3,14 +3,14 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
return yield import((yield import("./foo")).default);
});
return _foo.apply(this, arguments);
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es2015.2.minified.js
index cf78ab1856e1..660bcb029f55 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es2015.2.minified.js
@@ -1,2 +1,2 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es5.1.normal.js
index 77d085631991..341e2f00988d 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es5.1.normal.js
@@ -3,15 +3,15 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
+export default "./foo";
+// @filename: index.ts
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es5.2.minified.js
index a7609b071a23..cf8ad2fce58c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedES2020_es5.2.minified.js
@@ -1,3 +1,3 @@
+export default "./foo";
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es2015.1.normal.js
index 89d9ee9d9bf6..b781c5ab53ea 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es2015.1.normal.js
@@ -3,14 +3,14 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
return yield import((yield import("./foo")).default);
});
return _foo.apply(this, arguments);
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es2015.2.minified.js
index cf78ab1856e1..660bcb029f55 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es2015.2.minified.js
@@ -1,2 +1,2 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es5.1.normal.js
index 1a2a9fc78ca0..2dbb80a0d0bd 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es5.1.normal.js
@@ -3,15 +3,15 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
+export default "./foo";
+// @filename: index.ts
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es5.2.minified.js
index a7609b071a23..cf8ad2fce58c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem2_es5.2.minified.js
@@ -1,3 +1,3 @@
+export default "./foo";
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es2015.1.normal.js
index b87c66552732..a6c63d04a5cf 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es2015.1.normal.js
@@ -3,14 +3,14 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
return yield import((yield import("./foo")).default);
});
return _foo.apply(this, arguments);
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es2015.2.minified.js
index cf78ab1856e1..660bcb029f55 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es2015.2.minified.js
@@ -1,2 +1,2 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es5.1.normal.js
index 87207f31ade9..0374ac81ae3e 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es5.1.normal.js
@@ -3,15 +3,15 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
+export default "./foo";
+// @filename: index.ts
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es5.2.minified.js
index a7609b071a23..cf8ad2fce58c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedSystem_es5.2.minified.js
@@ -1,3 +1,3 @@
+export default "./foo";
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es2015.1.normal.js
index 6602eae4ec69..e7003269fab1 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es2015.1.normal.js
@@ -3,14 +3,14 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
return yield import((yield import("./foo")).default);
});
return _foo.apply(this, arguments);
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es2015.2.minified.js
index cf78ab1856e1..660bcb029f55 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es2015.2.minified.js
@@ -1,2 +1,2 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es5.1.normal.js
index 6139950736cc..c7d9fff4639a 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es5.1.normal.js
@@ -3,15 +3,15 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
+export default "./foo";
+// @filename: index.ts
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es5.2.minified.js
index a7609b071a23..cf8ad2fce58c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD2_es5.2.minified.js
@@ -1,3 +1,3 @@
+export default "./foo";
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es2015.1.normal.js
index 974554cb7ec8..e15fa26f1374 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es2015.1.normal.js
@@ -3,14 +3,14 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+// @filename: index.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(function*() {
+ _foo = _async_to_generator(function*() {
return yield import((yield import("./foo")).default);
});
return _foo.apply(this, arguments);
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es2015.2.minified.js
index cf78ab1856e1..660bcb029f55 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es2015.2.minified.js
@@ -1,2 +1,2 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export default "./foo";
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es5.1.normal.js
index b6b1ef85120d..1dbc50848792 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es5.1.normal.js
@@ -3,15 +3,15 @@
// @skipLibCheck: true
// @lib: es6
// @filename: foo.ts
+export default "./foo";
+// @filename: index.ts
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
- _foo = // @filename: index.ts
- _async_to_generator(regeneratorRuntime.mark(function _callee() {
+ _foo = _async_to_generator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es5.2.minified.js
index a7609b071a23..cf8ad2fce58c 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNestedUMD_es5.2.minified.js
@@ -1,3 +1,3 @@
+export default "./foo";
import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import regeneratorRuntime from "regenerator-runtime";
-export default "./foo";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es2015.1.normal.js
index 523faf6390d0..a770d11e2d87 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es2015.1.normal.js
@@ -1,6 +1,5 @@
// @lib: es5
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
@@ -13,6 +12,8 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
class C {
method() {
const loadAsync = import("./0");
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es2015.2.minified.js
index 3eb198ed5934..2e1781f4286f 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es2015.2.minified.js
@@ -1,4 +1,3 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
export class B {
print() {
return "I am B";
@@ -10,3 +9,4 @@ export function foo() {
export function backup() {
return "backup";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.1.normal.js
index 2437c6ff4e2d..ab990c23475e 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.1.normal.js
@@ -1,8 +1,6 @@
// @lib: es5
// @filename: 0.ts
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = /*#__PURE__*/ function() {
"use strict";
function B() {
@@ -21,6 +19,10 @@ export function foo() {
export function backup() {
return "backup";
}
+// @filename: 2.ts
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import regeneratorRuntime from "regenerator-runtime";
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
diff --git a/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.2.minified.js
index 940b5e30ea9c..197709aa2345 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionNoModuleKindSpecified_es5.2.minified.js
@@ -1,6 +1,4 @@
-import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var B = function() {
"use strict";
function B() {
@@ -16,6 +14,9 @@ export function foo() {
export function backup() {
return "backup";
}
+import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import regeneratorRuntime from "regenerator-runtime";
var C = function() {
"use strict";
function C() {
diff --git a/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es2015.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es2015.1.normal.js
index 99bef21c091e..3bc4696955dc 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es2015.1.normal.js
@@ -4,6 +4,7 @@
// @filename: defaultPath.ts
export class C {
}
+// @filename: 1.ts
import(`${directory}\\${moduleFile}`);
import(getSpecifier());
var p1 = import(ValidSomeCondition() ? "./0" : "externalModule");
@@ -21,3 +22,4 @@ function* loadModule(directories) {
import((yield path));
}
}
+export { };
diff --git a/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es2015.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es2015.2.minified.js
index 045751b04aaf..0d974c9693d8 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es2015.2.minified.js
@@ -3,3 +3,4 @@ export class C {
import(`${directory}\\${moduleFile}`), import(getSpecifier());
var p1 = (import(ValidSomeCondition() ? "./0" : "externalModule"), import(getSpecifier()));
import(getSpecifier()), import(whatToLoad ? getSpecifier() : "defaulPath"), p1.then((zero)=>zero.foo()), import(getSpecifier());
+export { };
diff --git a/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es5.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es5.1.normal.js
index 1cd8594f661c..ca9b18d56cc3 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es5.1.normal.js
@@ -3,12 +3,13 @@
// @noImplicitAny: true
// @filename: defaultPath.ts
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import regeneratorRuntime from "regenerator-runtime";
-var _marked = regeneratorRuntime.mark(loadModule);
export var C = function C() {
"use strict";
_class_call_check(this, C);
};
+// @filename: 1.ts
+import regeneratorRuntime from "regenerator-runtime";
+var _marked = regeneratorRuntime.mark(loadModule);
import("".concat(directory, "\\").concat(moduleFile));
import(getSpecifier());
var p1 = import(ValidSomeCondition() ? "./0" : "externalModule");
@@ -88,3 +89,4 @@ function loadModule(directories) {
]
]);
}
+export { };
diff --git a/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es5.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es5.2.minified.js
index 00b95d13a3f7..4c0c5b453fa1 100644
--- a/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importCallExpressionReturnPromiseOfAny_es5.2.minified.js
@@ -1,4 +1,8 @@
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+export var C = function() {
+ "use strict";
+ _class_call_check(this, C);
+};
import regeneratorRuntime from "regenerator-runtime";
var _marked = regeneratorRuntime.mark(function(directories) {
var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _$directory, path;
@@ -53,10 +57,6 @@ var _marked = regeneratorRuntime.mark(function(directories) {
]
]);
});
-export var C = function() {
- "use strict";
- _class_call_check(this, C);
-};
import("".concat(directory, "\\").concat(moduleFile)), import(getSpecifier());
var p1 = (import(ValidSomeCondition() ? "./0" : "externalModule"), import(getSpecifier()));
import(getSpecifier()), import(whatToLoad ? getSpecifier() : "defaulPath"), p1.then(function(zero) {
diff --git a/crates/swc/tests/tsc-references/importClause_default_es2015.1.normal.js b/crates/swc/tests/tsc-references/importClause_default_es2015.1.normal.js
index d5f7dcecec19..4c4d714a17e0 100644
--- a/crates/swc/tests/tsc-references/importClause_default_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importClause_default_es2015.1.normal.js
@@ -1,6 +1,7 @@
// @Filename: /a.ts
export default class A {
};
+// @Filename: /b.ts
new A();
let a = {
a: ''
@@ -8,3 +9,4 @@ let a = {
let b = {
A
};
+export { };
diff --git a/crates/swc/tests/tsc-references/importClause_default_es2015.2.minified.js b/crates/swc/tests/tsc-references/importClause_default_es2015.2.minified.js
index cbb702cdcc7f..14c2f409a084 100644
--- a/crates/swc/tests/tsc-references/importClause_default_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importClause_default_es2015.2.minified.js
@@ -1,3 +1,4 @@
export default class A {
};
new A();
+export { };
diff --git a/crates/swc/tests/tsc-references/importClause_default_es5.1.normal.js b/crates/swc/tests/tsc-references/importClause_default_es5.1.normal.js
index 2753e09adc39..9461998821e5 100644
--- a/crates/swc/tests/tsc-references/importClause_default_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importClause_default_es5.1.normal.js
@@ -5,6 +5,7 @@ var A = function A() {
_class_call_check(this, A);
};
export { A as default };
+// @Filename: /b.ts
new A();
var a = {
a: ""
@@ -12,3 +13,4 @@ var a = {
var b = {
A: A
};
+export { };
diff --git a/crates/swc/tests/tsc-references/importClause_default_es5.2.minified.js b/crates/swc/tests/tsc-references/importClause_default_es5.2.minified.js
index 4b5cdd8ad0a3..368c2282409c 100644
--- a/crates/swc/tests/tsc-references/importClause_default_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importClause_default_es5.2.minified.js
@@ -3,5 +3,6 @@ var A = function() {
"use strict";
_class_call_check(this, A);
};
-new A();
export { A as default };
+new A();
+export { };
diff --git a/crates/swc/tests/tsc-references/importDefaultNamedType_es2015.1.normal.js b/crates/swc/tests/tsc-references/importDefaultNamedType_es2015.1.normal.js
index 07c42e41d5f6..882b1570f054 100644
--- a/crates/swc/tests/tsc-references/importDefaultNamedType_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importDefaultNamedType_es2015.1.normal.js
@@ -1,3 +1,5 @@
// @Filename: /a.ts
export default class A {
};
+// @Filename: /b.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/importDefaultNamedType_es2015.2.minified.js b/crates/swc/tests/tsc-references/importDefaultNamedType_es2015.2.minified.js
index 95220774f32a..6b325c14be88 100644
--- a/crates/swc/tests/tsc-references/importDefaultNamedType_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importDefaultNamedType_es2015.2.minified.js
@@ -1,2 +1,3 @@
export default class A {
};
+export { };
diff --git a/crates/swc/tests/tsc-references/importDefaultNamedType_es5.1.normal.js b/crates/swc/tests/tsc-references/importDefaultNamedType_es5.1.normal.js
index 6e0fe2b07589..e4e499055a7a 100644
--- a/crates/swc/tests/tsc-references/importDefaultNamedType_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importDefaultNamedType_es5.1.normal.js
@@ -5,3 +5,5 @@ var A = function A() {
_class_call_check(this, A);
};
export { A as default };
+// @Filename: /b.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/importDefaultNamedType_es5.2.minified.js b/crates/swc/tests/tsc-references/importDefaultNamedType_es5.2.minified.js
index 32b7dd560e0c..29973a389dd7 100644
--- a/crates/swc/tests/tsc-references/importDefaultNamedType_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importDefaultNamedType_es5.2.minified.js
@@ -4,3 +4,4 @@ var A = function() {
_class_call_check(this, A);
};
export { A as default };
+export { };
diff --git a/crates/swc/tests/tsc-references/importEquals2_es2015.1.normal.js b/crates/swc/tests/tsc-references/importEquals2_es2015.1.normal.js
index 0ec230ab8679..1feff025d576 100644
--- a/crates/swc/tests/tsc-references/importEquals2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importEquals2_es2015.1.normal.js
@@ -2,9 +2,11 @@
// @Filename: /a.ts
class A {
}
+export { };
// @Filename: /b.ts
import * as a from './a';
+module.exports = a;
// @Filename: /c.ts
const a = require('./b');
new a.A(); // Error
-module.exports = a;
+export { };
diff --git a/crates/swc/tests/tsc-references/importEquals2_es2015.2.minified.js b/crates/swc/tests/tsc-references/importEquals2_es2015.2.minified.js
index aed571b6ff57..90dd239a62b3 100644
--- a/crates/swc/tests/tsc-references/importEquals2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importEquals2_es2015.2.minified.js
@@ -1,3 +1,6 @@
+export { };
import * as a from './a';
+module.exports = a;
let a = require('./b');
-new a.A(), module.exports = a;
+new a.A();
+export { };
diff --git a/crates/swc/tests/tsc-references/importEquals2_es5.1.normal.js b/crates/swc/tests/tsc-references/importEquals2_es5.1.normal.js
index af35c1b5ef84..4ecf30c50621 100644
--- a/crates/swc/tests/tsc-references/importEquals2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importEquals2_es5.1.normal.js
@@ -5,9 +5,11 @@ var A = function A() {
"use strict";
_class_call_check(this, A);
};
+export { };
// @Filename: /b.ts
import * as a from "./a";
+module.exports = a;
// @Filename: /c.ts
var a = require("./b");
new a.A(); // Error
-module.exports = a;
+export { };
diff --git a/crates/swc/tests/tsc-references/importEquals2_es5.2.minified.js b/crates/swc/tests/tsc-references/importEquals2_es5.2.minified.js
index b067b687e7d2..9d9377942747 100644
--- a/crates/swc/tests/tsc-references/importEquals2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importEquals2_es5.2.minified.js
@@ -4,5 +4,6 @@ var A = function() {
_class_call_check(this, A);
};
import * as a from "./a";
-var a = require("./b");
-new a.A(), module.exports = a;
+module.exports = a;
+new (require("./b")).A();
+export { };
diff --git a/crates/swc/tests/tsc-references/importImportOnlyModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/importImportOnlyModule_es2015.1.normal.js
index dcc6e1a4a7da..6b95eb227a09 100644
--- a/crates/swc/tests/tsc-references/importImportOnlyModule_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importImportOnlyModule_es2015.1.normal.js
@@ -9,6 +9,8 @@ C1.s1 = true;
// @Filename: foo_1.ts
const c1 = require('./foo_0'); // Makes this an external module
var answer = 42; // No exports
+export { };
// @Filename: foo_2.ts
const foo = require("./foo_1");
var x = foo; // Cause a runtime dependency
+export { };
diff --git a/crates/swc/tests/tsc-references/importImportOnlyModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/importImportOnlyModule_es2015.2.minified.js
index 84c0a46ab7e1..dc1a46b95ece 100644
--- a/crates/swc/tests/tsc-references/importImportOnlyModule_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importImportOnlyModule_es2015.2.minified.js
@@ -3,4 +3,8 @@ export class C1 {
this.m1 = 42;
}
}
-C1.s1 = !0, require('./foo_0'), require("./foo_1");
+C1.s1 = !0;
+require('./foo_0');
+export { };
+require("./foo_1");
+export { };
diff --git a/crates/swc/tests/tsc-references/importImportOnlyModule_es5.1.normal.js b/crates/swc/tests/tsc-references/importImportOnlyModule_es5.1.normal.js
index cbf7456c0e15..a266fbaf43b6 100644
--- a/crates/swc/tests/tsc-references/importImportOnlyModule_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importImportOnlyModule_es5.1.normal.js
@@ -10,6 +10,8 @@ C1.s1 = true;
// @Filename: foo_1.ts
var c1 = require("./foo_0"); // Makes this an external module
var answer = 42; // No exports
+export { };
// @Filename: foo_2.ts
var foo = require("./foo_1");
var x = foo; // Cause a runtime dependency
+export { };
diff --git a/crates/swc/tests/tsc-references/importImportOnlyModule_es5.2.minified.js b/crates/swc/tests/tsc-references/importImportOnlyModule_es5.2.minified.js
index a747f563f19d..df004a9b76b4 100644
--- a/crates/swc/tests/tsc-references/importImportOnlyModule_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importImportOnlyModule_es5.2.minified.js
@@ -3,4 +3,8 @@ export var C1 = function() {
"use strict";
_class_call_check(this, C1), this.m1 = 42;
};
-C1.s1 = !0, require("./foo_0"), require("./foo_1");
+C1.s1 = !0;
+require("./foo_0");
+export { };
+require("./foo_1");
+export { };
diff --git a/crates/swc/tests/tsc-references/importNonExternalModule_es5.2.minified.js b/crates/swc/tests/tsc-references/importNonExternalModule_es5.2.minified.js
index b3213446825d..f1152e24b6ba 100644
--- a/crates/swc/tests/tsc-references/importNonExternalModule_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importNonExternalModule_es5.2.minified.js
@@ -1,4 +1,4 @@
+var foo;
(foo || (foo = {})).answer = 42;
-var foo = require("./foo_0");
-foo.answer;
+require("./foo_0").answer;
export { };
diff --git a/crates/swc/tests/tsc-references/importTsBeforeDTs_es2015.1.normal.js b/crates/swc/tests/tsc-references/importTsBeforeDTs_es2015.1.normal.js
index d301e4506585..ae44df2664a9 100644
--- a/crates/swc/tests/tsc-references/importTsBeforeDTs_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importTsBeforeDTs_es2015.1.normal.js
@@ -7,3 +7,4 @@ export var y = 42;
const foo = require("./foo_0");
var z1 = foo.x + 10; // Should error, as .ts preferred over .d.ts
var z2 = foo.y + 10; // Should resolve
+export { };
diff --git a/crates/swc/tests/tsc-references/importTsBeforeDTs_es2015.2.minified.js b/crates/swc/tests/tsc-references/importTsBeforeDTs_es2015.2.minified.js
index 48cd017450fb..9661451ad0dc 100644
--- a/crates/swc/tests/tsc-references/importTsBeforeDTs_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importTsBeforeDTs_es2015.2.minified.js
@@ -2,3 +2,4 @@ export var x = 42;
export var y = 42;
let foo = require("./foo_0");
foo.x, foo.y;
+export { };
diff --git a/crates/swc/tests/tsc-references/importTsBeforeDTs_es5.1.normal.js b/crates/swc/tests/tsc-references/importTsBeforeDTs_es5.1.normal.js
index f0a1b7aabafb..df364827ad15 100644
--- a/crates/swc/tests/tsc-references/importTsBeforeDTs_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importTsBeforeDTs_es5.1.normal.js
@@ -7,3 +7,4 @@ export var y = 42;
var foo = require("./foo_0");
var z1 = foo.x + 10; // Should error, as .ts preferred over .d.ts
var z2 = foo.y + 10; // Should resolve
+export { };
diff --git a/crates/swc/tests/tsc-references/importTsBeforeDTs_es5.2.minified.js b/crates/swc/tests/tsc-references/importTsBeforeDTs_es5.2.minified.js
index 1dda33820bbd..e8df97e56685 100644
--- a/crates/swc/tests/tsc-references/importTsBeforeDTs_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importTsBeforeDTs_es5.2.minified.js
@@ -2,3 +2,4 @@ export var x = 42;
export var y = 42;
var foo = require("./foo_0");
foo.x, foo.y;
+export { };
diff --git a/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es2015.1.normal.js b/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es2015.1.normal.js
index 899a07984ad2..af2014013957 100644
--- a/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es2015.1.normal.js
@@ -2,6 +2,7 @@
// @module: amd
// @outFile: bundle.js
// @filename: a/b/c.ts
+export { };
// @filename: a/inner.ts
const c = {
x: 12
diff --git a/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es2015.2.minified.js b/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es2015.2.minified.js
index 78fb204078d2..f45422b6210f 100644
--- a/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es2015.2.minified.js
@@ -1,7 +1,9 @@
+export { };
let c = {
x: 12
};
+export { c };
let d = {
x: 12
};
-export { c, d };
+export { d };
diff --git a/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es5.1.normal.js b/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es5.1.normal.js
index 442b9457aa6a..d99415b4b26c 100644
--- a/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es5.1.normal.js
@@ -2,6 +2,7 @@
// @module: amd
// @outFile: bundle.js
// @filename: a/b/c.ts
+export { };
// @filename: a/inner.ts
var c = {
x: 12
diff --git a/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es5.2.minified.js b/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es5.2.minified.js
index 31cb5a64548f..356018d3aafa 100644
--- a/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importTypeAmdBundleRewrite_es5.2.minified.js
@@ -1,7 +1,9 @@
+export { };
var c = {
x: 12
};
+export { c };
var d = {
x: 12
};
-export { c, d };
+export { d };
diff --git a/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.1.normal.js b/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.1.normal.js
index 4852da96b363..89946f52fbb5 100644
--- a/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.1.normal.js
@@ -1,6 +1,9 @@
// @declaration: true
// @lib: es6
// @filename: foo.ts
+module.exports = Point;
+export { };
+// @filename: foo2.ts
class Bar {
constructor(input){}
}
@@ -26,4 +29,3 @@ export class Bar2 {
export let shim = {
Bar: Bar2
};
-module.exports = Point;
diff --git a/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.2.minified.js b/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.2.minified.js
index 33a9348cd99d..63b89c7540d2 100644
--- a/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importTypeGenericTypes_es2015.2.minified.js
@@ -1,6 +1,9 @@
+module.exports = Point;
+export { };
class Bar {
constructor(input){}
}
+export { Bar };
export const x = {
x: 0,
y: 0,
@@ -21,5 +24,3 @@ export class Bar2 {
export let shim = {
Bar: Bar2
};
-module.exports = Point;
-export { Bar };
diff --git a/crates/swc/tests/tsc-references/importTypeGenericTypes_es5.1.normal.js b/crates/swc/tests/tsc-references/importTypeGenericTypes_es5.1.normal.js
index 467f8b74ad5a..4642dde7386d 100644
--- a/crates/swc/tests/tsc-references/importTypeGenericTypes_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importTypeGenericTypes_es5.1.normal.js
@@ -1,6 +1,9 @@
// @declaration: true
// @lib: es6
// @filename: foo.ts
+module.exports = Point;
+export { };
+// @filename: foo2.ts
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Bar = function Bar(input) {
"use strict";
@@ -8,6 +11,7 @@ var Bar = function Bar(input) {
};
export { Bar };
// @filename: usage.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var x = {
x: 0,
y: 0,
@@ -29,4 +33,3 @@ export var Bar2 = function Bar2(input) {
export var shim = {
Bar: Bar2
};
-module.exports = Point;
diff --git a/crates/swc/tests/tsc-references/importTypeGenericTypes_es5.2.minified.js b/crates/swc/tests/tsc-references/importTypeGenericTypes_es5.2.minified.js
index 762ca627b974..dde6b79eb2bf 100644
--- a/crates/swc/tests/tsc-references/importTypeGenericTypes_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importTypeGenericTypes_es5.2.minified.js
@@ -1,8 +1,12 @@
+module.exports = Point;
+export { };
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Bar = function(input) {
"use strict";
_class_call_check(this, Bar);
};
+export { Bar };
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var x = {
x: 0,
y: 0,
@@ -24,5 +28,3 @@ export var Bar2 = function(input) {
export var shim = {
Bar: Bar2
};
-module.exports = Point;
-export { Bar };
diff --git a/crates/swc/tests/tsc-references/importTypeInJSDoc_es2015.1.normal.js b/crates/swc/tests/tsc-references/importTypeInJSDoc_es2015.1.normal.js
index 6b5298331ae9..9addf71cc3ef 100644
--- a/crates/swc/tests/tsc-references/importTypeInJSDoc_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importTypeInJSDoc_es2015.1.normal.js
@@ -3,6 +3,8 @@
// @allowJs: true
// @checkJs: true
// @filename: externs.d.ts
+module.exports = MyClass;
+export { };
// @filename: index.js
/**
* @typedef {import("./externs")} Foo
@@ -14,5 +16,3 @@ const q = /** @type {import("./externs").Bar} */ ({
doer: (q)=>q
});
const r = /** @type {typeof import("./externs").Bar} */ ((r)=>r);
-module.exports = MyClass;
-export { };
diff --git a/crates/swc/tests/tsc-references/importTypeInJSDoc_es2015.2.minified.js b/crates/swc/tests/tsc-references/importTypeInJSDoc_es2015.2.minified.js
index fe69ffd09d09..058ba3e61401 100644
--- a/crates/swc/tests/tsc-references/importTypeInJSDoc_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importTypeInJSDoc_es2015.2.minified.js
@@ -1,4 +1,5 @@
+module.exports = MyClass;
+export { };
new Foo({
doer: Foo.Bar
-}), module.exports = MyClass;
-export { };
+});
diff --git a/crates/swc/tests/tsc-references/importTypeInJSDoc_es5.1.normal.js b/crates/swc/tests/tsc-references/importTypeInJSDoc_es5.1.normal.js
index a45c34e79540..28e041857cda 100644
--- a/crates/swc/tests/tsc-references/importTypeInJSDoc_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importTypeInJSDoc_es5.1.normal.js
@@ -3,6 +3,8 @@
// @allowJs: true
// @checkJs: true
// @filename: externs.d.ts
+module.exports = MyClass;
+export { };
// @filename: index.js
/**
* @typedef {import("./externs")} Foo
@@ -18,5 +20,3 @@ var q = /** @type {import("./externs").Bar} */ ({
var r = /** @type {typeof import("./externs").Bar} */ function(r) {
return r;
};
-module.exports = MyClass;
-export { };
diff --git a/crates/swc/tests/tsc-references/importTypeInJSDoc_es5.2.minified.js b/crates/swc/tests/tsc-references/importTypeInJSDoc_es5.2.minified.js
index fe69ffd09d09..058ba3e61401 100644
--- a/crates/swc/tests/tsc-references/importTypeInJSDoc_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importTypeInJSDoc_es5.2.minified.js
@@ -1,4 +1,5 @@
+module.exports = MyClass;
+export { };
new Foo({
doer: Foo.Bar
-}), module.exports = MyClass;
-export { };
+});
diff --git a/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.1.normal.js b/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.1.normal.js
index ee913add08e8..35da7c419921 100644
--- a/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.1.normal.js
@@ -1,6 +1,9 @@
// @declaration: true
// @lib: es6
// @filename: foo.ts
+module.exports = Point;
+export { };
+// @filename: foo2.ts
class Bar {
constructor(input){}
}
@@ -24,4 +27,3 @@ export class Bar2 {
export let shim = {
Bar: Bar2
};
-module.exports = Point;
diff --git a/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.2.minified.js b/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.2.minified.js
index 73d7eff46d6f..95af08da2435 100644
--- a/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importTypeLocalMissing_es2015.2.minified.js
@@ -1,6 +1,9 @@
+module.exports = Point;
+export { };
class Bar {
constructor(input){}
}
+export { Bar };
export const x = {
x: 0,
y: 0
@@ -19,5 +22,3 @@ export class Bar2 {
export let shim = {
Bar: Bar2
};
-module.exports = Point;
-export { Bar };
diff --git a/crates/swc/tests/tsc-references/importTypeLocalMissing_es5.1.normal.js b/crates/swc/tests/tsc-references/importTypeLocalMissing_es5.1.normal.js
index 68cf67a4feaa..2d14835137ac 100644
--- a/crates/swc/tests/tsc-references/importTypeLocalMissing_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importTypeLocalMissing_es5.1.normal.js
@@ -1,6 +1,9 @@
// @declaration: true
// @lib: es6
// @filename: foo.ts
+module.exports = Point;
+export { };
+// @filename: foo2.ts
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Bar = function Bar(input) {
"use strict";
@@ -8,6 +11,7 @@ var Bar = function Bar(input) {
};
export { Bar };
// @filename: usage.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var x = {
x: 0,
y: 0
@@ -27,4 +31,3 @@ export var Bar2 = function Bar2(input) {
export var shim = {
Bar: Bar2
};
-module.exports = Point;
diff --git a/crates/swc/tests/tsc-references/importTypeLocalMissing_es5.2.minified.js b/crates/swc/tests/tsc-references/importTypeLocalMissing_es5.2.minified.js
index 6f5a40366a94..225ebd2ee095 100644
--- a/crates/swc/tests/tsc-references/importTypeLocalMissing_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importTypeLocalMissing_es5.2.minified.js
@@ -1,8 +1,12 @@
+module.exports = Point;
+export { };
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Bar = function(input) {
"use strict";
_class_call_check(this, Bar);
};
+export { Bar };
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var x = {
x: 0,
y: 0
@@ -22,5 +26,3 @@ export var Bar2 = function(input) {
export var shim = {
Bar: Bar2
};
-module.exports = Point;
-export { Bar };
diff --git a/crates/swc/tests/tsc-references/importTypeLocal_es2015.1.normal.js b/crates/swc/tests/tsc-references/importTypeLocal_es2015.1.normal.js
index d6a0a3865bcd..0d810b9ac19d 100644
--- a/crates/swc/tests/tsc-references/importTypeLocal_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importTypeLocal_es2015.1.normal.js
@@ -1,6 +1,9 @@
// @declaration: true
// @lib: es6
// @filename: foo.ts
+module.exports = Point;
+export { };
+// @filename: foo2.ts
class Bar {
constructor(input){}
}
@@ -20,4 +23,3 @@ export class Bar2 {
export let shim = {
Bar: Bar2
};
-module.exports = Point;
diff --git a/crates/swc/tests/tsc-references/importTypeLocal_es2015.2.minified.js b/crates/swc/tests/tsc-references/importTypeLocal_es2015.2.minified.js
index d7bb58c9723e..d858a31e33fd 100644
--- a/crates/swc/tests/tsc-references/importTypeLocal_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importTypeLocal_es2015.2.minified.js
@@ -1,6 +1,9 @@
+module.exports = Point;
+export { };
class Bar {
constructor(input){}
}
+export { Bar };
export const x = {
x: 0,
y: 0
@@ -15,5 +18,3 @@ export class Bar2 {
export let shim = {
Bar: Bar2
};
-module.exports = Point;
-export { Bar };
diff --git a/crates/swc/tests/tsc-references/importTypeLocal_es5.1.normal.js b/crates/swc/tests/tsc-references/importTypeLocal_es5.1.normal.js
index 259627ff3b03..c326da0d2144 100644
--- a/crates/swc/tests/tsc-references/importTypeLocal_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importTypeLocal_es5.1.normal.js
@@ -1,6 +1,9 @@
// @declaration: true
// @lib: es6
// @filename: foo.ts
+module.exports = Point;
+export { };
+// @filename: foo2.ts
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Bar = function Bar(input) {
"use strict";
@@ -8,6 +11,7 @@ var Bar = function Bar(input) {
};
export { Bar };
// @filename: usage.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var x = {
x: 0,
y: 0
@@ -23,4 +27,3 @@ export var Bar2 = function Bar2(input) {
export var shim = {
Bar: Bar2
};
-module.exports = Point;
diff --git a/crates/swc/tests/tsc-references/importTypeLocal_es5.2.minified.js b/crates/swc/tests/tsc-references/importTypeLocal_es5.2.minified.js
index cdacbb7d995b..024529f39905 100644
--- a/crates/swc/tests/tsc-references/importTypeLocal_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importTypeLocal_es5.2.minified.js
@@ -1,8 +1,12 @@
+module.exports = Point;
+export { };
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Bar = function(input) {
"use strict";
_class_call_check(this, Bar);
};
+export { Bar };
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var x = {
x: 0,
y: 0
@@ -18,5 +22,3 @@ export var Bar2 = function(input) {
export var shim = {
Bar: Bar2
};
-module.exports = Point;
-export { Bar };
diff --git a/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es2015.1.normal.js b/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es2015.1.normal.js
index 748c8a0ce811..5bb3cd224cdf 100644
--- a/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es2015.1.normal.js
@@ -3,14 +3,31 @@
export var x = 1;
var y = 1;
export { y };
-import * as a1 from "./a";
-const a2 = require("./a");
-const a3 = a1;
-x = 1; // Error
-y = 1; // Error
-a1.x = 1; // Error
-a1.y = 1; // Error
-a2.x = 1;
-a2.y = 1;
-a3.x = 1;
-a3.y = 1;
+// @filename: b.ts
+//!
+//! x cannot reassign to an imported binding
+//! ,-[2:1]
+//! 2 | import { x, y } from "./a";
+//! : |
+//! : `-- imported binding
+//! 3 | import * as a1 from "./a";
+//! 4 | import a2 = require("./a");
+//! 5 | const a3 = a1;
+//! 6 |
+//! 7 | x = 1; // Error
+//! : ^
+//! `----
+//!
+//! x cannot reassign to an imported binding
+//! ,-[2:1]
+//! 2 | import { x, y } from "./a";
+//! : |
+//! : `-- imported binding
+//! 3 | import * as a1 from "./a";
+//! 4 | import a2 = require("./a");
+//! 5 | const a3 = a1;
+//! 6 |
+//! 7 | x = 1; // Error
+//! 8 | y = 1; // Error
+//! : ^
+//! `----
diff --git a/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es2015.2.minified.js b/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es2015.2.minified.js
index b33234a91d7c..c7da3c366d9d 100644
--- a/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es2015.2.minified.js
@@ -1,6 +1,31 @@
export var x = 1;
var y = 1;
-import * as a1 from "./a";
-let a2 = require("./a"), a3 = a1;
-y = 1, a1.x = 1, a1.y = 1, a2.x = 1, a2.y = 1, a3.x = 1, a3.y = 1;
export { y };
+// @filename: b.ts
+//!
+//! x cannot reassign to an imported binding
+//! ,-[2:1]
+//! 2 | import { x, y } from "./a";
+//! : |
+//! : `-- imported binding
+//! 3 | import * as a1 from "./a";
+//! 4 | import a2 = require("./a");
+//! 5 | const a3 = a1;
+//! 6 |
+//! 7 | x = 1; // Error
+//! : ^
+//! `----
+//!
+//! x cannot reassign to an imported binding
+//! ,-[2:1]
+//! 2 | import { x, y } from "./a";
+//! : |
+//! : `-- imported binding
+//! 3 | import * as a1 from "./a";
+//! 4 | import a2 = require("./a");
+//! 5 | const a3 = a1;
+//! 6 |
+//! 7 | x = 1; // Error
+//! 8 | y = 1; // Error
+//! : ^
+//! `----
diff --git a/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es5.1.normal.js b/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es5.1.normal.js
index 6eb0e592409a..5bb3cd224cdf 100644
--- a/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es5.1.normal.js
@@ -3,14 +3,31 @@
export var x = 1;
var y = 1;
export { y };
-import * as a1 from "./a";
-var a2 = require("./a");
-var a3 = a1;
-x = 1; // Error
-y = 1; // Error
-a1.x = 1; // Error
-a1.y = 1; // Error
-a2.x = 1;
-a2.y = 1;
-a3.x = 1;
-a3.y = 1;
+// @filename: b.ts
+//!
+//! x cannot reassign to an imported binding
+//! ,-[2:1]
+//! 2 | import { x, y } from "./a";
+//! : |
+//! : `-- imported binding
+//! 3 | import * as a1 from "./a";
+//! 4 | import a2 = require("./a");
+//! 5 | const a3 = a1;
+//! 6 |
+//! 7 | x = 1; // Error
+//! : ^
+//! `----
+//!
+//! x cannot reassign to an imported binding
+//! ,-[2:1]
+//! 2 | import { x, y } from "./a";
+//! : |
+//! : `-- imported binding
+//! 3 | import * as a1 from "./a";
+//! 4 | import a2 = require("./a");
+//! 5 | const a3 = a1;
+//! 6 |
+//! 7 | x = 1; // Error
+//! 8 | y = 1; // Error
+//! : ^
+//! `----
diff --git a/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es5.2.minified.js b/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es5.2.minified.js
index 0e84c533e8c1..c7da3c366d9d 100644
--- a/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importsImplicitlyReadonly_es5.2.minified.js
@@ -1,6 +1,31 @@
export var x = 1;
var y = 1;
-import * as a1 from "./a";
-var a2 = require("./a"), a3 = a1;
-y = 1, a1.x = 1, a1.y = 1, a2.x = 1, a2.y = 1, a3.x = 1, a3.y = 1;
export { y };
+// @filename: b.ts
+//!
+//! x cannot reassign to an imported binding
+//! ,-[2:1]
+//! 2 | import { x, y } from "./a";
+//! : |
+//! : `-- imported binding
+//! 3 | import * as a1 from "./a";
+//! 4 | import a2 = require("./a");
+//! 5 | const a3 = a1;
+//! 6 |
+//! 7 | x = 1; // Error
+//! : ^
+//! `----
+//!
+//! x cannot reassign to an imported binding
+//! ,-[2:1]
+//! 2 | import { x, y } from "./a";
+//! : |
+//! : `-- imported binding
+//! 3 | import * as a1 from "./a";
+//! 4 | import a2 = require("./a");
+//! 5 | const a3 = a1;
+//! 6 |
+//! 7 | x = 1; // Error
+//! 8 | y = 1; // Error
+//! : ^
+//! `----
diff --git a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.1.normal.js b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.1.normal.js
index 8e5dad25bdc7..2455978e6007 100644
--- a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.1.normal.js
@@ -10,39 +10,58 @@ export var C;
C[C["One"] = 0] = "One";
C[C["Two"] = 1] = "Two";
})(C || (C = {}));
+// @Filename: /b.ts
let a;
let b;
console.log(a, b);
+export { };
+// @Filename: /c.ts
let a;
let b;
console.log(a, b);
+export { };
+// @Filename: /d.ts
+import { A } from './a';
const a = A;
let b;
console.log(a, b);
-0;
-let c = 1;
-let d = 1;
+// @Filename: /e.ts
+export { }; // noUnusedLocals error only
+// @Filename: /f.ts
+import { C } from './a';
+C.One;
+let c = C.Two;
+let d = C.Two;
console.log(c, d);
+// @Filename: /g.ts
let c;
let d;
console.log(c, d);
+export { };
// @Filename: /h.ts
class H {
}
+module.exports = H;
+export { };
// @Filename: /i.ts
const H = require('./h'); // Error
let h = {};
console.log(h);
+export { };
// @Filename: /j.ts
const H = require('./h'); // noUnusedLocals error only
-var // @Filename: /k.ts
-K;
+export { };
+// @Filename: /k.ts
+var K;
(function(K) {
K[K["One"] = 0] = "One";
K[K["Two"] = 1] = "Two";
})(K || (K = {}));
+module.exports = K;
+export { };
// @Filename: /l.ts
const K = require('./k');
-0; // @Filename: /j.ts
- // Sad face https://github.com/microsoft/TypeScript/blob/6b04f5039429b9d412696fe2febe39ecc69ad365/src/testRunner/compilerRunner.ts#L207
-module.exports = H;
+K.One;
+export { };
+// @Filename: /j.ts
+// Sad face https://github.com/microsoft/TypeScript/blob/6b04f5039429b9d412696fe2febe39ecc69ad365/src/testRunner/compilerRunner.ts#L207
diff --git a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.2.minified.js b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.2.minified.js
index 83aa09d54f59..a031c2042e4a 100644
--- a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es2015.2.minified.js
@@ -1,4 +1,3 @@
-var K;
export default class {
};
export class A {
@@ -9,17 +8,33 @@ export var C;
}(C || (C = {}));
let a, b;
console.log(a, b);
+export { };
let a, b;
console.log(a, b);
-let a = A, b;
-console.log(a, b), console.log(1, 1), console.log(1, 1);
-class H {
-}
-let H = require('./h');
-console.log({});
-let H = require('./h');
+export { };
+import { A } from './a';
+let b;
+console.log(A, b);
+export { };
+import { C } from './a';
+C.One;
+let c = C.Two, d = C.Two;
+console.log(c, d);
+let c, d;
+console.log(c, d);
+export { };
+module.exports = class {
+};
+export { };
+require('./h'), console.log({});
+export { };
+require('./h');
+export { };
+var K;
!function(K) {
K[K.One = 0] = "One", K[K.Two = 1] = "Two";
-}(K || (K = {}));
+}(K || (K = {})), module.exports = K;
+export { };
let K = require('./k');
-module.exports = H;
+K.One;
+export { };
diff --git a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.1.normal.js b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.1.normal.js
index a2172e1a051a..2e5e22e224ae 100644
--- a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.1.normal.js
@@ -16,41 +16,61 @@ export var C;
C[C["One"] = 0] = "One";
C[C["Two"] = 1] = "Two";
})(C || (C = {}));
+// @Filename: /b.ts
var a;
var b;
console.log(a, b);
+export { };
+// @Filename: /c.ts
var a;
var b;
console.log(a, b);
+export { };
+// @Filename: /d.ts
+import { A } from "./a";
var a = A;
var b;
console.log(a, b);
-0;
-var c = 1;
-var d = 1;
+// @Filename: /e.ts
+export { }; // noUnusedLocals error only
+// @Filename: /f.ts
+import { C } from "./a";
+C.One;
+var c = C.Two;
+var d = C.Two;
console.log(c, d);
+// @Filename: /g.ts
var c;
var d;
console.log(c, d);
+export { };
// @Filename: /h.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var H = function H() {
"use strict";
_class_call_check(this, H);
};
+module.exports = H;
+export { };
// @Filename: /i.ts
var H = require("./h"); // Error
var h = {};
console.log(h);
+export { };
// @Filename: /j.ts
var H = require("./h"); // noUnusedLocals error only
-var // @Filename: /k.ts
-K;
+export { };
+// @Filename: /k.ts
+var K;
(function(K) {
K[K["One"] = 0] = "One";
K[K["Two"] = 1] = "Two";
})(K || (K = {}));
+module.exports = K;
+export { };
// @Filename: /l.ts
var K = require("./k");
-0; // @Filename: /j.ts
- // Sad face https://github.com/microsoft/TypeScript/blob/6b04f5039429b9d412696fe2febe39ecc69ad365/src/testRunner/compilerRunner.ts#L207
-module.exports = H;
+K.One;
+export { };
+// @Filename: /j.ts
+// Sad face https://github.com/microsoft/TypeScript/blob/6b04f5039429b9d412696fe2febe39ecc69ad365/src/testRunner/compilerRunner.ts#L207
diff --git a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.2.minified.js b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.2.minified.js
index 3baa8ff113c6..2820dba4ea60 100644
--- a/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/importsNotUsedAsValues_error_es5.2.minified.js
@@ -1,5 +1,5 @@
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var a, b, c, d, K, _default = function() {
+var _default = function() {
"use strict";
_class_call_check(this, _default);
};
@@ -10,17 +10,39 @@ export var A = function() {
export var C;
!function(C) {
C[C.One = 0] = "One", C[C.Two = 1] = "Two";
-}(C || (C = {})), console.log(a, b), console.log(a, b);
-var a = A;
+}(C || (C = {}));
+export { _default as default };
+var a, b;
+console.log(a, b);
+export { };
+var a, b;
console.log(a, b);
-var c = 1, d = 1;
-console.log(c, d), console.log(c, d);
-var H = require("./h");
-console.log({});
-var H = require("./h");
+export { };
+var b;
+import { A } from "./a";
+console.log(A, b);
+export { };
+import { C } from "./a";
+C.One;
+var c = C.Two, d = C.Two;
+console.log(c, d);
+var c, d;
+console.log(c, d);
+export { };
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+var H = function() {
+ "use strict";
+ _class_call_check(this, H);
+};
+module.exports = H;
+require("./h"), console.log({});
+export { };
+require("./h");
+export { };
+var K;
!function(K) {
K[K.One = 0] = "One", K[K.Two = 1] = "Two";
-}(K || (K = {}));
-var K = require("./k");
-module.exports = H;
-export { _default as default };
+}(K || (K = {})), module.exports = K;
+export { };
+require("./k").One;
+export { };
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.1.normal.js
index a1e3936adf6a..f1b050a1362b 100644
--- a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.1.normal.js
@@ -1,22 +1,18 @@
-var // ++ operator on enum type
-ENUM;
-(function(ENUM) {})(ENUM || (ENUM = {}));
-var ENUM1;
-(function(ENUM1) {
- ENUM1[ENUM1["A"] = 0] = "A";
- ENUM1[ENUM1["B"] = 1] = "B";
- ENUM1[ENUM1[""] = 2] = "";
-})(ENUM1 || (ENUM1 = {}));
-// enum type var
-var ResultIsNumber1 = ++ENUM;
-var ResultIsNumber2 = ++ENUM1;
-var ResultIsNumber3 = ENUM++;
-var ResultIsNumber4 = ENUM1++;
-// enum type expressions
-var ResultIsNumber5 = ++ENUM[1] + ENUM[2];
-var ResultIsNumber6 = ENUM[1] + ENUM[2]++;
-// miss assignment operator
-++ENUM;
-++ENUM1;
-ENUM++;
-ENUM1++;
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 14 | var ResultIsNumber5 = ++(ENUM[1] + ENUM[2]);
+//! : ^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 15 | var ResultIsNumber6 = (ENUM[1] + ENUM[2])++;
+//! : ^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.2.minified.js
index 39951d0e7bf7..f1b050a1362b 100644
--- a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es2015.2.minified.js
@@ -1,4 +1,18 @@
-var ENUM, ENUM1;
-!function(ENUM1) {
- ENUM1[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "";
-}(ENUM1 || (ENUM1 = {})), ++ENUM, ++ENUM1, ENUM++, ENUM1++, ++ENUM[1] + ENUM[2], ENUM[1] + ENUM[2]++, ++ENUM, ++ENUM1, ENUM++, ENUM1++;
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 14 | var ResultIsNumber5 = ++(ENUM[1] + ENUM[2]);
+//! : ^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 15 | var ResultIsNumber6 = (ENUM[1] + ENUM[2])++;
+//! : ^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.1.normal.js
index a1e3936adf6a..f1b050a1362b 100644
--- a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.1.normal.js
@@ -1,22 +1,18 @@
-var // ++ operator on enum type
-ENUM;
-(function(ENUM) {})(ENUM || (ENUM = {}));
-var ENUM1;
-(function(ENUM1) {
- ENUM1[ENUM1["A"] = 0] = "A";
- ENUM1[ENUM1["B"] = 1] = "B";
- ENUM1[ENUM1[""] = 2] = "";
-})(ENUM1 || (ENUM1 = {}));
-// enum type var
-var ResultIsNumber1 = ++ENUM;
-var ResultIsNumber2 = ++ENUM1;
-var ResultIsNumber3 = ENUM++;
-var ResultIsNumber4 = ENUM1++;
-// enum type expressions
-var ResultIsNumber5 = ++ENUM[1] + ENUM[2];
-var ResultIsNumber6 = ENUM[1] + ENUM[2]++;
-// miss assignment operator
-++ENUM;
-++ENUM1;
-ENUM++;
-ENUM1++;
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 14 | var ResultIsNumber5 = ++(ENUM[1] + ENUM[2]);
+//! : ^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 15 | var ResultIsNumber6 = (ENUM[1] + ENUM[2])++;
+//! : ^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.2.minified.js
index 39951d0e7bf7..f1b050a1362b 100644
--- a/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithEnumTypeInvalidOperations_es5.2.minified.js
@@ -1,4 +1,18 @@
-var ENUM, ENUM1;
-!function(ENUM1) {
- ENUM1[ENUM1.A = 0] = "A", ENUM1[ENUM1.B = 1] = "B", ENUM1[ENUM1[""] = 2] = "";
-}(ENUM1 || (ENUM1 = {})), ++ENUM, ++ENUM1, ENUM++, ENUM1++, ++ENUM[1] + ENUM[2], ENUM[1] + ENUM[2]++, ++ENUM, ++ENUM1, ENUM++, ENUM1++;
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 14 | var ResultIsNumber5 = ++(ENUM[1] + ENUM[2]);
+//! : ^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 15 | var ResultIsNumber6 = (ENUM[1] + ENUM[2])++;
+//! : ^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithNumberTypeInvalidOperations_es2015.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithNumberTypeInvalidOperations_es2015.1.normal.js
new file mode 100644
index 000000000000..007285e2d464
--- /dev/null
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithNumberTypeInvalidOperations_es2015.1.normal.js
@@ -0,0 +1,102 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 22 | var ResultIsNumber3 = ++1;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 23 | var ResultIsNumber4 = ++{ x: 1, y: 2};
+//! : ^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 24 | var ResultIsNumber5 = ++{ x: 1, y: (n: number) => { return n; } };
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 26 | var ResultIsNumber6 = 1++;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 27 | var ResultIsNumber7 = { x: 1, y: 2 }++;
+//! : ^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 28 | var ResultIsNumber8 = { x: 1, y: (n: number) => { return n; } }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 31 | var ResultIsNumber9 = ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 32 | var ResultIsNumber10 = ++A.foo();
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 33 | var ResultIsNumber11 = ++(NUMBER + NUMBER);
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 35 | var ResultIsNumber12 = foo()++;
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 36 | var ResultIsNumber13 = A.foo()++;
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 37 | var ResultIsNumber14 = (NUMBER + NUMBER)++;
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 40 | ++1;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 42 | ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 44 | 1++;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 46 | foo()++;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithNumberTypeInvalidOperations_es2015.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithNumberTypeInvalidOperations_es2015.2.minified.js
new file mode 100644
index 000000000000..007285e2d464
--- /dev/null
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithNumberTypeInvalidOperations_es2015.2.minified.js
@@ -0,0 +1,102 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 22 | var ResultIsNumber3 = ++1;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 23 | var ResultIsNumber4 = ++{ x: 1, y: 2};
+//! : ^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 24 | var ResultIsNumber5 = ++{ x: 1, y: (n: number) => { return n; } };
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 26 | var ResultIsNumber6 = 1++;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 27 | var ResultIsNumber7 = { x: 1, y: 2 }++;
+//! : ^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 28 | var ResultIsNumber8 = { x: 1, y: (n: number) => { return n; } }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 31 | var ResultIsNumber9 = ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 32 | var ResultIsNumber10 = ++A.foo();
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 33 | var ResultIsNumber11 = ++(NUMBER + NUMBER);
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 35 | var ResultIsNumber12 = foo()++;
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 36 | var ResultIsNumber13 = A.foo()++;
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 37 | var ResultIsNumber14 = (NUMBER + NUMBER)++;
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 40 | ++1;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 42 | ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 44 | 1++;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 46 | foo()++;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithNumberTypeInvalidOperations_es5.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithNumberTypeInvalidOperations_es5.1.normal.js
new file mode 100644
index 000000000000..007285e2d464
--- /dev/null
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithNumberTypeInvalidOperations_es5.1.normal.js
@@ -0,0 +1,102 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 22 | var ResultIsNumber3 = ++1;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 23 | var ResultIsNumber4 = ++{ x: 1, y: 2};
+//! : ^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 24 | var ResultIsNumber5 = ++{ x: 1, y: (n: number) => { return n; } };
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 26 | var ResultIsNumber6 = 1++;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 27 | var ResultIsNumber7 = { x: 1, y: 2 }++;
+//! : ^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 28 | var ResultIsNumber8 = { x: 1, y: (n: number) => { return n; } }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 31 | var ResultIsNumber9 = ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 32 | var ResultIsNumber10 = ++A.foo();
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 33 | var ResultIsNumber11 = ++(NUMBER + NUMBER);
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 35 | var ResultIsNumber12 = foo()++;
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 36 | var ResultIsNumber13 = A.foo()++;
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 37 | var ResultIsNumber14 = (NUMBER + NUMBER)++;
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 40 | ++1;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 42 | ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 44 | 1++;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 46 | foo()++;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithNumberTypeInvalidOperations_es5.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithNumberTypeInvalidOperations_es5.2.minified.js
new file mode 100644
index 000000000000..007285e2d464
--- /dev/null
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithNumberTypeInvalidOperations_es5.2.minified.js
@@ -0,0 +1,102 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 22 | var ResultIsNumber3 = ++1;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 23 | var ResultIsNumber4 = ++{ x: 1, y: 2};
+//! : ^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 24 | var ResultIsNumber5 = ++{ x: 1, y: (n: number) => { return n; } };
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 26 | var ResultIsNumber6 = 1++;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 27 | var ResultIsNumber7 = { x: 1, y: 2 }++;
+//! : ^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 28 | var ResultIsNumber8 = { x: 1, y: (n: number) => { return n; } }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 31 | var ResultIsNumber9 = ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 32 | var ResultIsNumber10 = ++A.foo();
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 33 | var ResultIsNumber11 = ++(NUMBER + NUMBER);
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 35 | var ResultIsNumber12 = foo()++;
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 36 | var ResultIsNumber13 = A.foo()++;
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 37 | var ResultIsNumber14 = (NUMBER + NUMBER)++;
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 40 | ++1;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 42 | ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 44 | 1++;
+//! : ^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 46 | foo()++;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedBooleanType_es2015.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedBooleanType_es2015.1.normal.js
new file mode 100644
index 000000000000..695d8e0c8c3b
--- /dev/null
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedBooleanType_es2015.1.normal.js
@@ -0,0 +1,90 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 22 | var ResultIsNumber3 = ++true;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 23 | var ResultIsNumber4 = ++{ x: true, y: false };
+//! : ^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 24 | var ResultIsNumber5 = ++{ x: true, y: (n: boolean) => { return n; } };
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 26 | var ResultIsNumber6 = true++;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 27 | var ResultIsNumber7 = { x: true, y: false }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 28 | var ResultIsNumber8 = { x: true, y: (n: boolean) => { return n; } }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 33 | var ResultIsNumber11 = ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 34 | var ResultIsNumber12 = ++A.foo();
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 36 | var ResultIsNumber13 = foo()++;
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 37 | var ResultIsNumber14 = A.foo()++;
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 42 | ++true;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 44 | ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 49 | true++;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 51 | foo()++;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedBooleanType_es2015.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedBooleanType_es2015.2.minified.js
new file mode 100644
index 000000000000..695d8e0c8c3b
--- /dev/null
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedBooleanType_es2015.2.minified.js
@@ -0,0 +1,90 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 22 | var ResultIsNumber3 = ++true;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 23 | var ResultIsNumber4 = ++{ x: true, y: false };
+//! : ^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 24 | var ResultIsNumber5 = ++{ x: true, y: (n: boolean) => { return n; } };
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 26 | var ResultIsNumber6 = true++;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 27 | var ResultIsNumber7 = { x: true, y: false }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 28 | var ResultIsNumber8 = { x: true, y: (n: boolean) => { return n; } }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 33 | var ResultIsNumber11 = ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 34 | var ResultIsNumber12 = ++A.foo();
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 36 | var ResultIsNumber13 = foo()++;
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 37 | var ResultIsNumber14 = A.foo()++;
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 42 | ++true;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 44 | ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 49 | true++;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 51 | foo()++;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedBooleanType_es5.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedBooleanType_es5.1.normal.js
new file mode 100644
index 000000000000..695d8e0c8c3b
--- /dev/null
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedBooleanType_es5.1.normal.js
@@ -0,0 +1,90 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 22 | var ResultIsNumber3 = ++true;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 23 | var ResultIsNumber4 = ++{ x: true, y: false };
+//! : ^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 24 | var ResultIsNumber5 = ++{ x: true, y: (n: boolean) => { return n; } };
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 26 | var ResultIsNumber6 = true++;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 27 | var ResultIsNumber7 = { x: true, y: false }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 28 | var ResultIsNumber8 = { x: true, y: (n: boolean) => { return n; } }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 33 | var ResultIsNumber11 = ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 34 | var ResultIsNumber12 = ++A.foo();
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 36 | var ResultIsNumber13 = foo()++;
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 37 | var ResultIsNumber14 = A.foo()++;
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 42 | ++true;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 44 | ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 49 | true++;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 51 | foo()++;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedBooleanType_es5.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedBooleanType_es5.2.minified.js
new file mode 100644
index 000000000000..695d8e0c8c3b
--- /dev/null
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedBooleanType_es5.2.minified.js
@@ -0,0 +1,90 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 22 | var ResultIsNumber3 = ++true;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 23 | var ResultIsNumber4 = ++{ x: true, y: false };
+//! : ^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 24 | var ResultIsNumber5 = ++{ x: true, y: (n: boolean) => { return n; } };
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 26 | var ResultIsNumber6 = true++;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 27 | var ResultIsNumber7 = { x: true, y: false }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 28 | var ResultIsNumber8 = { x: true, y: (n: boolean) => { return n; } }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 33 | var ResultIsNumber11 = ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 34 | var ResultIsNumber12 = ++A.foo();
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 36 | var ResultIsNumber13 = foo()++;
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 37 | var ResultIsNumber14 = A.foo()++;
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 42 | ++true;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 44 | ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 49 | true++;
+//! : ^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 51 | foo()++;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedStringType_es2015.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedStringType_es2015.1.normal.js
new file mode 100644
index 000000000000..c741905b44b2
--- /dev/null
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedStringType_es2015.1.normal.js
@@ -0,0 +1,102 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 25 | var ResultIsNumber5 = ++"";
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 26 | var ResultIsNumber6 = ++{ x: "", y: "" };
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 27 | var ResultIsNumber7 = ++{ x: "", y: (s: string) => { return s; } };
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 29 | var ResultIsNumber8 = ""++;
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 30 | var ResultIsNumber9 = { x: "", y: "" }++;
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 31 | var ResultIsNumber10 = { x: "", y: (s: string) => { return s; } }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 37 | var ResultIsNumber14 = ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 38 | var ResultIsNumber15 = ++A.foo();
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 39 | var ResultIsNumber16 = ++(STRING + STRING);
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 44 | var ResultIsNumber20 = foo()++;
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 45 | var ResultIsNumber21 = A.foo()++;
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 46 | var ResultIsNumber22 = (STRING + STRING)++;
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 49 | ++"";
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 53 | ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 58 | ""++;
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 62 | foo()++;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedStringType_es2015.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedStringType_es2015.2.minified.js
new file mode 100644
index 000000000000..c741905b44b2
--- /dev/null
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedStringType_es2015.2.minified.js
@@ -0,0 +1,102 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 25 | var ResultIsNumber5 = ++"";
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 26 | var ResultIsNumber6 = ++{ x: "", y: "" };
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 27 | var ResultIsNumber7 = ++{ x: "", y: (s: string) => { return s; } };
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 29 | var ResultIsNumber8 = ""++;
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 30 | var ResultIsNumber9 = { x: "", y: "" }++;
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 31 | var ResultIsNumber10 = { x: "", y: (s: string) => { return s; } }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 37 | var ResultIsNumber14 = ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 38 | var ResultIsNumber15 = ++A.foo();
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 39 | var ResultIsNumber16 = ++(STRING + STRING);
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 44 | var ResultIsNumber20 = foo()++;
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 45 | var ResultIsNumber21 = A.foo()++;
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 46 | var ResultIsNumber22 = (STRING + STRING)++;
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 49 | ++"";
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 53 | ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 58 | ""++;
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 62 | foo()++;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedStringType_es5.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedStringType_es5.1.normal.js
new file mode 100644
index 000000000000..c741905b44b2
--- /dev/null
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedStringType_es5.1.normal.js
@@ -0,0 +1,102 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 25 | var ResultIsNumber5 = ++"";
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 26 | var ResultIsNumber6 = ++{ x: "", y: "" };
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 27 | var ResultIsNumber7 = ++{ x: "", y: (s: string) => { return s; } };
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 29 | var ResultIsNumber8 = ""++;
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 30 | var ResultIsNumber9 = { x: "", y: "" }++;
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 31 | var ResultIsNumber10 = { x: "", y: (s: string) => { return s; } }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 37 | var ResultIsNumber14 = ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 38 | var ResultIsNumber15 = ++A.foo();
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 39 | var ResultIsNumber16 = ++(STRING + STRING);
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 44 | var ResultIsNumber20 = foo()++;
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 45 | var ResultIsNumber21 = A.foo()++;
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 46 | var ResultIsNumber22 = (STRING + STRING)++;
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 49 | ++"";
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 53 | ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 58 | ""++;
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 62 | foo()++;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedStringType_es5.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedStringType_es5.2.minified.js
new file mode 100644
index 000000000000..c741905b44b2
--- /dev/null
+++ b/crates/swc/tests/tsc-references/incrementOperatorWithUnsupportedStringType_es5.2.minified.js
@@ -0,0 +1,102 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 25 | var ResultIsNumber5 = ++"";
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 26 | var ResultIsNumber6 = ++{ x: "", y: "" };
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 27 | var ResultIsNumber7 = ++{ x: "", y: (s: string) => { return s; } };
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 29 | var ResultIsNumber8 = ""++;
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 30 | var ResultIsNumber9 = { x: "", y: "" }++;
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 31 | var ResultIsNumber10 = { x: "", y: (s: string) => { return s; } }++;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 37 | var ResultIsNumber14 = ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 38 | var ResultIsNumber15 = ++A.foo();
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 39 | var ResultIsNumber16 = ++(STRING + STRING);
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 44 | var ResultIsNumber20 = foo()++;
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 45 | var ResultIsNumber21 = A.foo()++;
+//! : ^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 46 | var ResultIsNumber22 = (STRING + STRING)++;
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 49 | ++"";
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 53 | ++foo();
+//! : ^^^^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 58 | ""++;
+//! : ^^
+//! `----
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 62 | foo()++;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es2015.2.minified.js b/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es2015.2.minified.js
index 0b72c4fb14db..1e9ddd549858 100644
--- a/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es2015.2.minified.js
@@ -8,14 +8,8 @@ export var C2 = class {
C2.staticProp = 0;
export let F2 = function() {};
F2.staticProp = 0;
-class C3 {
-}
-function F3() {}
-C3.staticProp = 0, F3.staticProp = 0;
-var C4 = class {
-};
-C4.staticProp = 0;
-let F4 = function() {};
-F4.staticProp = 0;
+(class {
+}).staticProp = 0, (function() {}).staticProp = 0, (class {
+}).staticProp = 0, (function() {}).staticProp = 0;
import * as a from "./a";
a.C1.staticProp, a.C2.staticProp, a.F1.staticProp, a.F2.staticProp, C3.staticProp, C4.staticProp, F3.staticProp, F4.staticProp;
diff --git a/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.1.normal.js b/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.1.normal.js
index 3f94f1008db1..0fcf9395c111 100644
--- a/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.1.normal.js
@@ -17,6 +17,7 @@ C2.staticProp = 0;
export var F2 = function F2() {};
F2.staticProp = 0;
//@filename: global.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var C3 = function C3() {
"use strict";
_class_call_check(this, C3);
diff --git a/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.2.minified.js b/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.2.minified.js
index e98b923a5ddc..d903361c6dc5 100644
--- a/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/inferringClassStaticMembersFromAssignments_es5.2.minified.js
@@ -13,18 +13,16 @@ export var C2 = function() {
C2.staticProp = 0;
export var F2 = function() {};
F2.staticProp = 0;
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var C3 = function() {
"use strict";
_class_call_check(this, C3);
};
-function F3() {}
-C3.staticProp = 0, F3.staticProp = 0;
+C3.staticProp = 0, (function() {}).staticProp = 0;
var C4 = function() {
"use strict";
_class_call_check(this, C4);
};
-C4.staticProp = 0;
-var F4 = function() {};
-F4.staticProp = 0;
+C4.staticProp = 0, (function() {}).staticProp = 0;
import * as a from "./a";
a.C1.staticProp, a.C2.staticProp, a.F1.staticProp, a.F2.staticProp, C3.staticProp, C4.staticProp, F3.staticProp, F4.staticProp;
diff --git a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es2015.1.normal.js b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es2015.1.normal.js
index a7f133c0e4eb..b007082f25d3 100644
--- a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es2015.1.normal.js
@@ -2,7 +2,14 @@
// @jsxFactory: createElement
// @jsxFragmentFactory: Fragment
// @filename: react.d.ts
-/*#__PURE__*/ h(Frag, null, /*#__PURE__*/ h("span", null));
+export { };
+// @filename: preact.d.ts
+export { };
+// @filename: snabbdom.d.ts
+export { };
+// @filename: reacty.tsx
+/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("span", null));
+export { };
// @filename: preacty.tsx
/**
* @jsx h
@@ -14,7 +21,8 @@
* @jsx h
* @jsxfrag null
*/ import { h } from "./snabbdom";
-/*#__PURE__*/ h(Frag, null, /*#__PURE__*/ h("div", null));
+/*#__PURE__*/ h(React.Fragment, null, /*#__PURE__*/ h("div", null));
// @filename: mix-n-match.tsx
/* @jsx h */ /* @jsxFrag Fragment */ import { h } from "./preact";
-/*#__PURE__*/ h(Frag, null, /*#__PURE__*/ h("span", null));
+import { Fragment } from "./react";
+/*#__PURE__*/ h(Fragment, null, /*#__PURE__*/ h("span", null));
diff --git a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es2015.2.minified.js b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es2015.2.minified.js
index 3d67ad68af7f..4689d16f393f 100644
--- a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es2015.2.minified.js
@@ -1,3 +1,10 @@
+export { };
+export { };
+export { };
+React.Fragment;
+export { };
import { h, Frag } from "./preact";
import { h } from "./snabbdom";
+React.Fragment;
import { h } from "./preact";
+import { Fragment } from "./react";
diff --git a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es5.1.normal.js b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es5.1.normal.js
index a7f133c0e4eb..b007082f25d3 100644
--- a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es5.1.normal.js
@@ -2,7 +2,14 @@
// @jsxFactory: createElement
// @jsxFragmentFactory: Fragment
// @filename: react.d.ts
-/*#__PURE__*/ h(Frag, null, /*#__PURE__*/ h("span", null));
+export { };
+// @filename: preact.d.ts
+export { };
+// @filename: snabbdom.d.ts
+export { };
+// @filename: reacty.tsx
+/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("span", null));
+export { };
// @filename: preacty.tsx
/**
* @jsx h
@@ -14,7 +21,8 @@
* @jsx h
* @jsxfrag null
*/ import { h } from "./snabbdom";
-/*#__PURE__*/ h(Frag, null, /*#__PURE__*/ h("div", null));
+/*#__PURE__*/ h(React.Fragment, null, /*#__PURE__*/ h("div", null));
// @filename: mix-n-match.tsx
/* @jsx h */ /* @jsxFrag Fragment */ import { h } from "./preact";
-/*#__PURE__*/ h(Frag, null, /*#__PURE__*/ h("span", null));
+import { Fragment } from "./react";
+/*#__PURE__*/ h(Fragment, null, /*#__PURE__*/ h("span", null));
diff --git a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es5.2.minified.js b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es5.2.minified.js
index 3d67ad68af7f..4689d16f393f 100644
--- a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragmaOverridesCompilerOptions_es5.2.minified.js
@@ -1,3 +1,10 @@
+export { };
+export { };
+export { };
+React.Fragment;
+export { };
import { h, Frag } from "./preact";
import { h } from "./snabbdom";
+React.Fragment;
import { h } from "./preact";
+import { Fragment } from "./react";
diff --git a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es2015.1.normal.js b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es2015.1.normal.js
index 48db12a3ad50..8496cd3ca88d 100644
--- a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es2015.1.normal.js
@@ -1,20 +1,25 @@
// @jsx: react
// @noUnusedLocals: true
// @filename: renderer.d.ts
+export { };
// @filename: preacty.tsx
/**
* @jsx h
* @jsxFrag Fragment
*/ import { h, Fragment } from "./renderer";
/*#__PURE__*/ h(Fragment, null, /*#__PURE__*/ h("div", null));
-/*#__PURE__*/ h(Fragment, null, /*#__PURE__*/ h("span", null));
+// @filename: snabbdomy.tsx
+/* @jsx jsx */ /* @jsxfrag null */ import { jsx } from "./renderer";
+/*#__PURE__*/ jsx(React.Fragment, null, /*#__PURE__*/ jsx("span", null));
// @filename: preacty-only-fragment.tsx
/**
* @jsx h
* @jsxFrag Fragment
*/ import { h, Fragment } from "./renderer";
/*#__PURE__*/ h(Fragment, null);
-/*#__PURE__*/ h(Fragment, null);
+// @filename: snabbdomy-only-fragment.tsx
+/* @jsx jsx */ /* @jsxfrag null */ import { jsx } from "./renderer";
+/*#__PURE__*/ jsx(React.Fragment, null);
// @filename: preacty-only-fragment-no-jsx.tsx
/**
* @jsx h
@@ -23,14 +28,16 @@
/*#__PURE__*/ h(Fragment, null);
// @filename: snabbdomy-only-fragment-no-jsx.tsx
/* @jsx jsx */ /* @jsxfrag null */ import "./renderer";
-/*#__PURE__*/ h(Fragment, null);
+/*#__PURE__*/ jsx(React.Fragment, null);
// @filename: preacty-no-fragment.tsx
/**
* @jsx h
* @jsxFrag Fragment
*/ import { h, Fragment } from "./renderer";
/*#__PURE__*/ h("div", null);
-/*#__PURE__*/ h("div", null);
+// @filename: snabbdomy-no-fragment.tsx
+/* @jsx jsx */ /* @jsxfrag null */ import { jsx } from "./renderer";
+/*#__PURE__*/ jsx("div", null);
// @filename: preacty-only-component.tsx
/**
* @jsx h
diff --git a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es2015.2.minified.js b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es2015.2.minified.js
index 2715214423d7..9acdbd8a2903 100644
--- a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es2015.2.minified.js
@@ -1,6 +1,13 @@
+export { };
import { h, Fragment } from "./renderer";
+import { jsx } from "./renderer";
+React.Fragment;
import { h, Fragment } from "./renderer";
+import { jsx } from "./renderer";
+React.Fragment;
import { Fragment } from "./renderer";
import "./renderer";
+React.Fragment;
import { h, Fragment } from "./renderer";
+import { jsx } from "./renderer";
import { h } from "./renderer";
diff --git a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es5.1.normal.js b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es5.1.normal.js
index 48db12a3ad50..8496cd3ca88d 100644
--- a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es5.1.normal.js
@@ -1,20 +1,25 @@
// @jsx: react
// @noUnusedLocals: true
// @filename: renderer.d.ts
+export { };
// @filename: preacty.tsx
/**
* @jsx h
* @jsxFrag Fragment
*/ import { h, Fragment } from "./renderer";
/*#__PURE__*/ h(Fragment, null, /*#__PURE__*/ h("div", null));
-/*#__PURE__*/ h(Fragment, null, /*#__PURE__*/ h("span", null));
+// @filename: snabbdomy.tsx
+/* @jsx jsx */ /* @jsxfrag null */ import { jsx } from "./renderer";
+/*#__PURE__*/ jsx(React.Fragment, null, /*#__PURE__*/ jsx("span", null));
// @filename: preacty-only-fragment.tsx
/**
* @jsx h
* @jsxFrag Fragment
*/ import { h, Fragment } from "./renderer";
/*#__PURE__*/ h(Fragment, null);
-/*#__PURE__*/ h(Fragment, null);
+// @filename: snabbdomy-only-fragment.tsx
+/* @jsx jsx */ /* @jsxfrag null */ import { jsx } from "./renderer";
+/*#__PURE__*/ jsx(React.Fragment, null);
// @filename: preacty-only-fragment-no-jsx.tsx
/**
* @jsx h
@@ -23,14 +28,16 @@
/*#__PURE__*/ h(Fragment, null);
// @filename: snabbdomy-only-fragment-no-jsx.tsx
/* @jsx jsx */ /* @jsxfrag null */ import "./renderer";
-/*#__PURE__*/ h(Fragment, null);
+/*#__PURE__*/ jsx(React.Fragment, null);
// @filename: preacty-no-fragment.tsx
/**
* @jsx h
* @jsxFrag Fragment
*/ import { h, Fragment } from "./renderer";
/*#__PURE__*/ h("div", null);
-/*#__PURE__*/ h("div", null);
+// @filename: snabbdomy-no-fragment.tsx
+/* @jsx jsx */ /* @jsxfrag null */ import { jsx } from "./renderer";
+/*#__PURE__*/ jsx("div", null);
// @filename: preacty-only-component.tsx
/**
* @jsx h
diff --git a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es5.2.minified.js b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es5.2.minified.js
index 2715214423d7..9acdbd8a2903 100644
--- a/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/inlineJsxAndJsxFragPragma_es5.2.minified.js
@@ -1,6 +1,13 @@
+export { };
import { h, Fragment } from "./renderer";
+import { jsx } from "./renderer";
+React.Fragment;
import { h, Fragment } from "./renderer";
+import { jsx } from "./renderer";
+React.Fragment;
import { Fragment } from "./renderer";
import "./renderer";
+React.Fragment;
import { h, Fragment } from "./renderer";
+import { jsx } from "./renderer";
import { h } from "./renderer";
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es2015.1.normal.js b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es2015.1.normal.js
index 89d3cac04957..dabae8832abe 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es2015.1.normal.js
@@ -1,63 +1,25 @@
// @jsx: react
// @filename: renderer.d.ts
+export { };
+// @filename: renderer2.d.ts
+export { };
// @filename: component.tsx
-/** @jsx predom */ import { predom } from "./renderer2";
-export const MySFC = (props)=>/*#__PURE__*/ predom("p", null, props.x, " + ", props.y, " = ", props.x + props.y);
-export class MyClass {
- render() {
- return /*#__PURE__*/ predom("p", null, this.props.x, " + ", this.props.y, " = ", this.props.x + this.props.y);
- }
- constructor(props){
- this.props = props;
- }
-}
-export const tree = /*#__PURE__*/ predom(MySFC, {
- x: 1,
- y: 2
-}, /*#__PURE__*/ predom(MyClass, {
- x: 3,
- y: 4
-}), /*#__PURE__*/ predom(MyClass, {
- x: 5,
- y: 6
-}));
-export default /*#__PURE__*/ predom("h", null);
-import prerendered from "./component";
-let elem = prerendered;
-elem = /*#__PURE__*/ predom("h", null); // Expect assignability error here
-const DOMSFC = (props)=>/*#__PURE__*/ predom("p", null, props.x, " + ", props.y, " = ", props.x + props.y, props.children);
-class DOMClass {
- render() {
- return /*#__PURE__*/ predom("p", null, this.props.x, " + ", this.props.y, " = ", this.props.x + this.props.y);
- }
- constructor(props){
- this.props = props;
- }
-}
-// Should work, everything is a DOM element
-const _tree = /*#__PURE__*/ predom(DOMSFC, {
- x: 1,
- y: 2
-}, /*#__PURE__*/ predom(DOMClass, {
- x: 3,
- y: 4
-}), /*#__PURE__*/ predom(DOMClass, {
- x: 5,
- y: 6
-}));
-// Should fail, no dom elements
-const _brokenTree = /*#__PURE__*/ predom(MySFC, {
- x: 1,
- y: 2
-}, /*#__PURE__*/ predom(MyClass, {
- x: 3,
- y: 4
-}), /*#__PURE__*/ predom(MyClass, {
- x: 5,
- y: 6
-}));
-// Should fail, nondom isn't allowed as children of dom
-const _brokenTree2 = /*#__PURE__*/ predom(DOMSFC, {
- x: 1,
- y: 2
-}, tree, tree);
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 5 | export const MySFC = (props: {x: number, y: number, children?: predom.JSX.Element[]}) => {props.x} + {props.y} = {props.x + props.y}{...this.props.children}
;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 13 | {...this.props.children}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+// @filename: index.tsx
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 14 | return {this.props.x} + {this.props.y} = {this.props.x + this.props.y}{...this.props.children}
;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es2015.2.minified.js b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es2015.2.minified.js
index 606a630ac6ad..3b1219bda1f4 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es2015.2.minified.js
@@ -1,22 +1,22 @@
-import { predom } from "./renderer2";
-export const MySFC = (props)=>predom("p", null, props.x, " + ", props.y, " = ", props.x + props.y);
-export class MyClass {
- render() {
- return predom("p", null, this.props.x, " + ", this.props.y, " = ", this.props.x + this.props.y);
- }
- constructor(props){
- this.props = props;
- }
-}
-export const tree = predom(MySFC, {
- x: 1,
- y: 2
-}, predom(MyClass, {
- x: 3,
- y: 4
-}), predom(MyClass, {
- x: 5,
- y: 6
-}));
-export default predom("h", null);
-import prerendered from "./component";
+export { };
+export { };
+// @filename: component.tsx
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 5 | export const MySFC = (props: {x: number, y: number, children?: predom.JSX.Element[]}) => {props.x} + {props.y} = {props.x + props.y}{...this.props.children}
;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 13 | {...this.props.children}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+// @filename: index.tsx
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 14 | return {this.props.x} + {this.props.y} = {this.props.x + this.props.y}{...this.props.children}
;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es5.1.normal.js b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es5.1.normal.js
index f9b9b7f8c6e3..dabae8832abe 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es5.1.normal.js
@@ -1,76 +1,25 @@
// @jsx: react
// @filename: renderer.d.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+export { };
+// @filename: renderer2.d.ts
+export { };
// @filename: component.tsx
-/** @jsx predom */ import { predom } from "./renderer2";
-export var MySFC = function(props) {
- return /*#__PURE__*/ predom("p", null, props.x, " + ", props.y, " = ", props.x + props.y);
-};
-export var MyClass = /*#__PURE__*/ function() {
- "use strict";
- function MyClass(props) {
- _class_call_check(this, MyClass);
- this.props = props;
- }
- var _proto = MyClass.prototype;
- _proto.render = function render() {
- return /*#__PURE__*/ predom("p", null, this.props.x, " + ", this.props.y, " = ", this.props.x + this.props.y);
- };
- return MyClass;
-}();
-export var tree = /*#__PURE__*/ predom(MySFC, {
- x: 1,
- y: 2
-}, /*#__PURE__*/ predom(MyClass, {
- x: 3,
- y: 4
-}), /*#__PURE__*/ predom(MyClass, {
- x: 5,
- y: 6
-}));
-export default /*#__PURE__*/ predom("h", null);
-import prerendered from "./component";
-var elem = prerendered;
-elem = /*#__PURE__*/ predom("h", null); // Expect assignability error here
-var DOMSFC = function(props) {
- return /*#__PURE__*/ predom("p", null, props.x, " + ", props.y, " = ", props.x + props.y, props.children);
-};
-var DOMClass = /*#__PURE__*/ function() {
- "use strict";
- function DOMClass(props) {
- _class_call_check(this, DOMClass);
- this.props = props;
- }
- var _proto = DOMClass.prototype;
- _proto.render = function render() {
- return /*#__PURE__*/ predom("p", null, this.props.x, " + ", this.props.y, " = ", this.props.x + this.props.y);
- };
- return DOMClass;
-}();
-// Should work, everything is a DOM element
-var _tree = /*#__PURE__*/ predom(DOMSFC, {
- x: 1,
- y: 2
-}, /*#__PURE__*/ predom(DOMClass, {
- x: 3,
- y: 4
-}), /*#__PURE__*/ predom(DOMClass, {
- x: 5,
- y: 6
-}));
-// Should fail, no dom elements
-var _brokenTree = /*#__PURE__*/ predom(MySFC, {
- x: 1,
- y: 2
-}, /*#__PURE__*/ predom(MyClass, {
- x: 3,
- y: 4
-}), /*#__PURE__*/ predom(MyClass, {
- x: 5,
- y: 6
-}));
-// Should fail, nondom isn't allowed as children of dom
-var _brokenTree2 = /*#__PURE__*/ predom(DOMSFC, {
- x: 1,
- y: 2
-}, tree, tree);
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 5 | export const MySFC = (props: {x: number, y: number, children?: predom.JSX.Element[]}) => {props.x} + {props.y} = {props.x + props.y}{...this.props.children}
;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 13 | {...this.props.children}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+// @filename: index.tsx
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 14 | return {this.props.x} + {this.props.y} = {this.props.x + this.props.y}{...this.props.children}
;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es5.2.minified.js b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es5.2.minified.js
index 673ca04752da..3b1219bda1f4 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarationsLocalTypes_es5.2.minified.js
@@ -1,35 +1,22 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import { predom } from "./renderer2";
-export var MySFC = function(props) {
- return predom("p", null, props.x, " + ", props.y, " = ", props.x + props.y);
-};
-export var MyClass = function() {
- "use strict";
- function MyClass(props) {
- _class_call_check(this, MyClass), this.props = props;
- }
- return MyClass.prototype.render = function() {
- return predom("p", null, this.props.x, " + ", this.props.y, " = ", this.props.x + this.props.y);
- }, MyClass;
-}();
-export var tree = predom(MySFC, {
- x: 1,
- y: 2
-}, predom(MyClass, {
- x: 3,
- y: 4
-}), predom(MyClass, {
- x: 5,
- y: 6
-}));
-export default predom("h", null);
-import prerendered from "./component";
-var DOMClass = function() {
- "use strict";
- function DOMClass(props) {
- _class_call_check(this, DOMClass), this.props = props;
- }
- return DOMClass.prototype.render = function() {
- return predom("p", null, this.props.x, " + ", this.props.y, " = ", this.props.x + this.props.y);
- }, DOMClass;
-}();
+export { };
+export { };
+// @filename: component.tsx
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 5 | export const MySFC = (props: {x: number, y: number, children?: predom.JSX.Element[]}) => {props.x} + {props.y} = {props.x + props.y}{...this.props.children}
;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 13 | {...this.props.children}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+// @filename: index.tsx
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 14 | return {this.props.x} + {this.props.y} = {this.props.x + this.props.y}{...this.props.children}
;
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarations_es2015.1.normal.js b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarations_es2015.1.normal.js
new file mode 100644
index 000000000000..688ee92dc5e0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarations_es2015.1.normal.js
@@ -0,0 +1,33 @@
+// @jsx: react
+// @filename: renderer.d.ts
+export { dom as default };
+// @filename: otherreacty.tsx
+/** @jsx React.createElement */ import * as React from "./renderer";
+/*#__PURE__*/ React.createElement("h", null);
+// @filename: other.tsx
+/** @jsx h */ import { dom as h } from "./renderer";
+export const prerendered = /*#__PURE__*/ h("h", null);
+// @filename: othernoalias.tsx
+/** @jsx otherdom */ import { otherdom } from "./renderer";
+export const prerendered2 = /*#__PURE__*/ otherdom("h", null);
+// @filename: reacty.tsx
+import React from "./renderer";
+export const prerendered3 = /*#__PURE__*/ React.createElement("h", null);
+// @filename: index.tsx
+//!
+//! x Expression expected
+//! ,----
+//! 4 |
+//! : ^
+//! `----
+//!
+//! x Unexpected token `/`. Expected jsx identifier
+//! ,----
+//! 4 |
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarations_es2015.2.minified.js b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarations_es2015.2.minified.js
new file mode 100644
index 000000000000..61f996bed3d8
--- /dev/null
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarations_es2015.2.minified.js
@@ -0,0 +1,26 @@
+export { dom as default };
+import * as React from "./renderer";
+import { dom as h } from "./renderer";
+export const prerendered = h("h", null);
+import { otherdom } from "./renderer";
+export const prerendered2 = otherdom("h", null);
+import React from "./renderer";
+export const prerendered3 = React.createElement("h", null);
+// @filename: index.tsx
+//!
+//! x Expression expected
+//! ,----
+//! 4 |
+//! : ^
+//! `----
+//!
+//! x Unexpected token `/`. Expected jsx identifier
+//! ,----
+//! 4 |
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarations_es5.1.normal.js b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarations_es5.1.normal.js
new file mode 100644
index 000000000000..c4b9033e485e
--- /dev/null
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarations_es5.1.normal.js
@@ -0,0 +1,33 @@
+// @jsx: react
+// @filename: renderer.d.ts
+export { dom as default };
+// @filename: otherreacty.tsx
+/** @jsx React.createElement */ import * as React from "./renderer";
+/*#__PURE__*/ React.createElement("h", null);
+// @filename: other.tsx
+/** @jsx h */ import { dom as h } from "./renderer";
+export var prerendered = /*#__PURE__*/ h("h", null);
+// @filename: othernoalias.tsx
+/** @jsx otherdom */ import { otherdom } from "./renderer";
+export var prerendered2 = /*#__PURE__*/ otherdom("h", null);
+// @filename: reacty.tsx
+import React from "./renderer";
+export var prerendered3 = /*#__PURE__*/ React.createElement("h", null);
+// @filename: index.tsx
+//!
+//! x Expression expected
+//! ,----
+//! 4 |
+//! : ^
+//! `----
+//!
+//! x Unexpected token `/`. Expected jsx identifier
+//! ,----
+//! 4 |
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarations_es5.2.minified.js b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarations_es5.2.minified.js
new file mode 100644
index 000000000000..65b0cc791ca3
--- /dev/null
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryDeclarations_es5.2.minified.js
@@ -0,0 +1,26 @@
+export { dom as default };
+import * as React from "./renderer";
+import { dom as h } from "./renderer";
+export var prerendered = h("h", null);
+import { otherdom } from "./renderer";
+export var prerendered2 = otherdom("h", null);
+import React from "./renderer";
+export var prerendered3 = React.createElement("h", null);
+// @filename: index.tsx
+//!
+//! x Expression expected
+//! ,----
+//! 4 |
+//! : ^
+//! `----
+//!
+//! x Unexpected token `/`. Expected jsx identifier
+//! ,----
+//! 4 |
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es2015.1.normal.js b/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es2015.1.normal.js
index a7ca9785bf38..5dcda9b07bc9 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es2015.1.normal.js
@@ -1,8 +1,13 @@
// @jsx: react
// @filename: renderer.d.ts
+export { };
+// @filename: renderer2.d.ts
+export { };
// @filename: component.tsx
/** @jsx predom */ import { predom } from "./renderer2";
export default /*#__PURE__*/ predom("h", null);
+// @filename: index.tsx
+/** @jsx dom */ import { dom } from "./renderer";
import prerendered from "./component";
let elem = prerendered;
-elem = /*#__PURE__*/ predom("h", null); // Expect assignability error here
+elem = /*#__PURE__*/ dom("h", null); // Expect assignability error here
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es2015.2.minified.js b/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es2015.2.minified.js
index c5afd4162064..bb8c4451fbc7 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es2015.2.minified.js
@@ -1,3 +1,6 @@
+export { };
+export { };
import { predom } from "./renderer2";
export default predom("h", null);
+import { dom } from "./renderer";
import prerendered from "./component";
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es5.1.normal.js b/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es5.1.normal.js
index c04ac20d110b..9fafb12cd549 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es5.1.normal.js
@@ -1,8 +1,13 @@
// @jsx: react
// @filename: renderer.d.ts
+export { };
+// @filename: renderer2.d.ts
+export { };
// @filename: component.tsx
/** @jsx predom */ import { predom } from "./renderer2";
export default /*#__PURE__*/ predom("h", null);
+// @filename: index.tsx
+/** @jsx dom */ import { dom } from "./renderer";
import prerendered from "./component";
var elem = prerendered;
-elem = /*#__PURE__*/ predom("h", null); // Expect assignability error here
+elem = /*#__PURE__*/ dom("h", null); // Expect assignability error here
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es5.2.minified.js b/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es5.2.minified.js
index c5afd4162064..bb8c4451fbc7 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryLocalTypeGlobalFallback_es5.2.minified.js
@@ -1,3 +1,6 @@
+export { };
+export { };
import { predom } from "./renderer2";
export default predom("h", null);
+import { dom } from "./renderer";
import prerendered from "./component";
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es2015.1.normal.js b/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es2015.1.normal.js
index 0e6f928ec28a..42625b754444 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es2015.1.normal.js
@@ -6,5 +6,5 @@ export { dom as p };
/** @jsx dom */ import { dom } from "./renderer";
/*#__PURE__*/ dom("h", null);
// @filename: index.tsx
-import { p } from "./renderer";
-/*#__PURE__*/ dom("h", null);
+/*#__PURE__*/ React.createElement("h", null);
+export { };
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es2015.2.minified.js b/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es2015.2.minified.js
index 21a94df3c1d3..302a2fb6a702 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es2015.2.minified.js
@@ -1,3 +1,3 @@
-import { dom } from "./renderer";
-import { p } from "./renderer";
export { dom as p };
+import { dom } from "./renderer";
+export { };
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es5.1.normal.js b/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es5.1.normal.js
index 0e6f928ec28a..42625b754444 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es5.1.normal.js
@@ -6,5 +6,5 @@ export { dom as p };
/** @jsx dom */ import { dom } from "./renderer";
/*#__PURE__*/ dom("h", null);
// @filename: index.tsx
-import { p } from "./renderer";
-/*#__PURE__*/ dom("h", null);
+/*#__PURE__*/ React.createElement("h", null);
+export { };
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es5.2.minified.js b/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es5.2.minified.js
index 21a94df3c1d3..302a2fb6a702 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryOverridesCompilerOption_es5.2.minified.js
@@ -1,3 +1,3 @@
-import { dom } from "./renderer";
-import { p } from "./renderer";
export { dom as p };
+import { dom } from "./renderer";
+export { };
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es2015.1.normal.js b/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es2015.1.normal.js
index 99a8577fc336..1386e8ab7782 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es2015.1.normal.js
@@ -1,6 +1,9 @@
// @jsx: react
// @filename: renderer.d.ts
+export { };
// @filename: reacty.tsx
/** @jsx React.createElement */ import * as React from "./renderer";
/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("h", null));
-/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("h", null));
+// @filename: index.tsx
+/** @jsx dom */ import { dom } from "./renderer";
+/*#__PURE__*/ dom(React.Fragment, null, /*#__PURE__*/ dom("h", null));
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es2015.2.minified.js b/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es2015.2.minified.js
index 82ae9ee69dd4..aa863cfabf7b 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es2015.2.minified.js
@@ -1,2 +1,5 @@
+export { };
import * as React from "./renderer";
-React.Fragment, React.Fragment;
+React.Fragment;
+import { dom } from "./renderer";
+React.Fragment;
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es5.1.normal.js b/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es5.1.normal.js
index 99a8577fc336..1386e8ab7782 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es5.1.normal.js
@@ -1,6 +1,9 @@
// @jsx: react
// @filename: renderer.d.ts
+export { };
// @filename: reacty.tsx
/** @jsx React.createElement */ import * as React from "./renderer";
/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("h", null));
-/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("h", null));
+// @filename: index.tsx
+/** @jsx dom */ import { dom } from "./renderer";
+/*#__PURE__*/ dom(React.Fragment, null, /*#__PURE__*/ dom("h", null));
diff --git a/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es5.2.minified.js b/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es5.2.minified.js
index 82ae9ee69dd4..aa863cfabf7b 100644
--- a/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/inlineJsxFactoryWithFragmentIsError_es5.2.minified.js
@@ -1,2 +1,5 @@
+export { };
import * as React from "./renderer";
-React.Fragment, React.Fragment;
+React.Fragment;
+import { dom } from "./renderer";
+React.Fragment;
diff --git a/crates/swc/tests/tsc-references/interfaceExtendingOptionalChain_es2015.1.normal.js b/crates/swc/tests/tsc-references/interfaceExtendingOptionalChain_es2015.1.normal.js
new file mode 100644
index 000000000000..ed9ca98233cc
--- /dev/null
+++ b/crates/swc/tests/tsc-references/interfaceExtendingOptionalChain_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x An interface can only extend an identifier/qualified-name with optional type arguments.
+//! ,----
+//! 5 | interface C1 extends Foo?.Bar {}
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/interfaceExtendingOptionalChain_es2015.2.minified.js b/crates/swc/tests/tsc-references/interfaceExtendingOptionalChain_es2015.2.minified.js
new file mode 100644
index 000000000000..ed9ca98233cc
--- /dev/null
+++ b/crates/swc/tests/tsc-references/interfaceExtendingOptionalChain_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x An interface can only extend an identifier/qualified-name with optional type arguments.
+//! ,----
+//! 5 | interface C1 extends Foo?.Bar {}
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/interfaceExtendingOptionalChain_es5.1.normal.js b/crates/swc/tests/tsc-references/interfaceExtendingOptionalChain_es5.1.normal.js
new file mode 100644
index 000000000000..ed9ca98233cc
--- /dev/null
+++ b/crates/swc/tests/tsc-references/interfaceExtendingOptionalChain_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x An interface can only extend an identifier/qualified-name with optional type arguments.
+//! ,----
+//! 5 | interface C1 extends Foo?.Bar {}
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/interfaceExtendingOptionalChain_es5.2.minified.js b/crates/swc/tests/tsc-references/interfaceExtendingOptionalChain_es5.2.minified.js
new file mode 100644
index 000000000000..ed9ca98233cc
--- /dev/null
+++ b/crates/swc/tests/tsc-references/interfaceExtendingOptionalChain_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x An interface can only extend an identifier/qualified-name with optional type arguments.
+//! ,----
+//! 5 | interface C1 extends Foo?.Bar {}
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/interfacesWithPredefinedTypesAsNames_es2015.1.normal.js b/crates/swc/tests/tsc-references/interfacesWithPredefinedTypesAsNames_es2015.1.normal.js
new file mode 100644
index 000000000000..eebd786ac31b
--- /dev/null
+++ b/crates/swc/tests/tsc-references/interfacesWithPredefinedTypesAsNames_es2015.1.normal.js
@@ -0,0 +1,48 @@
+//!
+//! x interface name is invalid
+//! ,----
+//! 1 | interface any { }
+//! : ^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 2 | interface number { }
+//! : ^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 3 | interface string { }
+//! : ^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 4 | interface boolean { }
+//! : ^^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 5 | interface void {}
+//! : ^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 6 | interface unknown {}
+//! : ^^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 7 | interface never {}
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/interfacesWithPredefinedTypesAsNames_es2015.2.minified.js b/crates/swc/tests/tsc-references/interfacesWithPredefinedTypesAsNames_es2015.2.minified.js
new file mode 100644
index 000000000000..eebd786ac31b
--- /dev/null
+++ b/crates/swc/tests/tsc-references/interfacesWithPredefinedTypesAsNames_es2015.2.minified.js
@@ -0,0 +1,48 @@
+//!
+//! x interface name is invalid
+//! ,----
+//! 1 | interface any { }
+//! : ^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 2 | interface number { }
+//! : ^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 3 | interface string { }
+//! : ^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 4 | interface boolean { }
+//! : ^^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 5 | interface void {}
+//! : ^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 6 | interface unknown {}
+//! : ^^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 7 | interface never {}
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/interfacesWithPredefinedTypesAsNames_es5.1.normal.js b/crates/swc/tests/tsc-references/interfacesWithPredefinedTypesAsNames_es5.1.normal.js
new file mode 100644
index 000000000000..eebd786ac31b
--- /dev/null
+++ b/crates/swc/tests/tsc-references/interfacesWithPredefinedTypesAsNames_es5.1.normal.js
@@ -0,0 +1,48 @@
+//!
+//! x interface name is invalid
+//! ,----
+//! 1 | interface any { }
+//! : ^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 2 | interface number { }
+//! : ^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 3 | interface string { }
+//! : ^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 4 | interface boolean { }
+//! : ^^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 5 | interface void {}
+//! : ^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 6 | interface unknown {}
+//! : ^^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 7 | interface never {}
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/interfacesWithPredefinedTypesAsNames_es5.2.minified.js b/crates/swc/tests/tsc-references/interfacesWithPredefinedTypesAsNames_es5.2.minified.js
new file mode 100644
index 000000000000..eebd786ac31b
--- /dev/null
+++ b/crates/swc/tests/tsc-references/interfacesWithPredefinedTypesAsNames_es5.2.minified.js
@@ -0,0 +1,48 @@
+//!
+//! x interface name is invalid
+//! ,----
+//! 1 | interface any { }
+//! : ^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 2 | interface number { }
+//! : ^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 3 | interface string { }
+//! : ^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 4 | interface boolean { }
+//! : ^^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 5 | interface void {}
+//! : ^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 6 | interface unknown {}
+//! : ^^^^^^^
+//! `----
+//!
+//! x interface name is invalid
+//! ,----
+//! 7 | interface never {}
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.1.normal.js b/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.1.normal.js
index a1f7b2529967..d3e9917bb6f3 100644
--- a/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.1.normal.js
@@ -41,4 +41,5 @@ var myChoicesAndEmpty;
var unknownChoices;
var unknownChoicesAndEmpty;
mock(import('./ex'));
+// @filename: ex.d.ts
export { };
diff --git a/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.2.minified.js b/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.2.minified.js
index 84e619a3ce6d..d9276d98a29a 100644
--- a/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es2015.2.minified.js
@@ -1,15 +1,15 @@
-let intersectDictionaries = (d1, d2)=>Object.assign({}, d1, d2), testDictionary = (_value)=>{}, d1 = {};
+const intersectDictionaries = (d1, d2)=>Object.assign({}, d1, d2), testDictionary = (_value)=>{}, d1 = {};
testDictionary(d1);
-let d2 = intersectDictionaries(d1, d1);
+const d2 = intersectDictionaries(d1, d1);
testDictionary(d2);
-let d3 = {
+const d3 = {
s: ''
};
testDictionary(d3);
-let d4 = intersectDictionaries(d1, d3);
+const d4 = intersectDictionaries(d1, d3);
testDictionary(d4);
-let d5 = intersectDictionaries(d3, d1);
+const d5 = intersectDictionaries(d3, d1);
testDictionary(d5);
-let d6 = intersectDictionaries(d3, d3);
+const d6 = intersectDictionaries(d3, d3);
testDictionary(d6), mock(import('./ex'));
export { };
diff --git a/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es5.1.normal.js b/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es5.1.normal.js
index 36891e96f888..8a31a398fb35 100644
--- a/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/intersectionsAndEmptyObjects_es5.1.normal.js
@@ -43,4 +43,5 @@ var myChoicesAndEmpty;
var unknownChoices;
var unknownChoicesAndEmpty;
mock(import("./ex"));
+// @filename: ex.d.ts
export { };
diff --git a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.1.normal.js
index e419320d9be0..b5440e22e9dc 100644
--- a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.1.normal.js
@@ -1,13 +1,10 @@
-var M;
-(function(M) {
- class Point {
- }
- M.Point = Point;
- var Point = M.Point = 1;
-})(M || (M = {}));
-var M2;
-(function(M2) {
- var Point = M2.Point = 1;
-})(M2 || (M2 = {}));
-var m = M2;
-var p; // Error
+//!
+//! x the name `Point` is defined multiple times
+//! ,-[2:5]
+//! 2 | export class Point { x: number; y: number }
+//! : ^^|^^
+//! : `-- previous definition of `Point` here
+//! 3 | export var Point = 1; // Error
+//! : ^^|^^
+//! : `-- `Point` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.2.minified.js
index b427a6afebc7..b5440e22e9dc 100644
--- a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es2015.2.minified.js
@@ -1,7 +1,10 @@
-var M, M2;
-!function(M) {
- class Point {
- }
- M.Point = Point;
- var Point = M.Point = 1;
-}(M || (M = {})), (M2 || (M2 = {})).Point = 1;
+//!
+//! x the name `Point` is defined multiple times
+//! ,-[2:5]
+//! 2 | export class Point { x: number; y: number }
+//! : ^^|^^
+//! : `-- previous definition of `Point` here
+//! 3 | export var Point = 1; // Error
+//! : ^^|^^
+//! : `-- `Point` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.1.normal.js b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.1.normal.js
index e4cddeee8ec4..b5440e22e9dc 100644
--- a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.1.normal.js
@@ -1,16 +1,10 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var M;
-(function(M) {
- var Point = function Point() {
- "use strict";
- _class_call_check(this, Point);
- };
- M.Point = Point;
- var Point = M.Point = 1;
-})(M || (M = {}));
-var M2;
-(function(M2) {
- var Point = M2.Point = 1;
-})(M2 || (M2 = {}));
-var m = M2;
-var p; // Error
+//!
+//! x the name `Point` is defined multiple times
+//! ,-[2:5]
+//! 2 | export class Point { x: number; y: number }
+//! : ^^|^^
+//! : `-- previous definition of `Point` here
+//! 3 | export var Point = 1; // Error
+//! : ^^|^^
+//! : `-- `Point` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.2.minified.js b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.2.minified.js
index ba502aab3642..b5440e22e9dc 100644
--- a/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/invalidInstantiatedModule_es5.2.minified.js
@@ -1,10 +1,10 @@
-var M, M2;
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-!function(M) {
- var Point = function() {
- "use strict";
- _class_call_check(this, Point);
- };
- M.Point = Point;
- var Point = M.Point = 1;
-}(M || (M = {})), (M2 || (M2 = {})).Point = 1;
+//!
+//! x the name `Point` is defined multiple times
+//! ,-[2:5]
+//! 2 | export class Point { x: number; y: number }
+//! : ^^|^^
+//! : `-- previous definition of `Point` here
+//! 3 | export var Point = 1; // Error
+//! : ^^|^^
+//! : `-- `Point` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es2015.2.minified.js
index c975bb09fc0e..3a1d22b5ca08 100644
--- a/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es2015.2.minified.js
@@ -1,2 +1,3 @@
const a = {};
-a.d = function() {}, a.d.prototype = {};
+a.d = function() {};
+a.d.prototype = {};
diff --git a/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es5.2.minified.js b/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es5.2.minified.js
index 8f094e55a146..1500631efac8 100644
--- a/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsContainerMergeJsContainer_es5.2.minified.js
@@ -1,2 +1,2 @@
-var a = {};
-a.d = function() {}, a.d.prototype = {};
+({}).d = function() {};
+a.d.prototype = {};
diff --git a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es2015.2.minified.js
index 39e6fc25b792..346e3e3778b7 100644
--- a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es2015.2.minified.js
@@ -1,3 +1 @@
-var x = function() {};
-x.a = function() {};
-var x = 1;
+(function() {}).a = function() {};
diff --git a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es5.2.minified.js b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es5.2.minified.js
index 39e6fc25b792..346e3e3778b7 100644
--- a/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsContainerMergeTsDeclaration_es5.2.minified.js
@@ -1,3 +1 @@
-var x = function() {};
-x.a = function() {};
-var x = 1;
+(function() {}).a = function() {};
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.1.normal.js
index c9982beb58b7..878aa1e74107 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.1.normal.js
@@ -4,6 +4,7 @@
// @outDir: ./out
// @declaration: true
// @filename: supplement.d.ts
+export { };
// @filename: base.js
export class Base {
toJSON() {
@@ -16,6 +17,8 @@ export class Base {
}
constructor(){}
}
+// @filename: argument.js
+import { Base } from "./base.js";
export class Argument extends Base {
/**
* @param {*} tokeniser
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.2.minified.js
index 72e884c82657..bf714bae143f 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es2015.2.minified.js
@@ -1,3 +1,4 @@
+export { };
export class Base {
toJSON() {
return {
@@ -8,6 +9,7 @@ export class Base {
}
constructor(){}
}
+import { Base } from "./base.js";
export class Argument extends Base {
static parse(tokeniser) {}
get type() {
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.1.normal.js
index a35a94c2a0c8..7ec252cd17e8 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.1.normal.js
@@ -4,12 +4,9 @@
// @outDir: ./out
// @declaration: true
// @filename: supplement.d.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _create_class from "@swc/helpers/src/_create_class.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
-import regeneratorRuntime from "regenerator-runtime";
+export { };
// @filename: base.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var Base = /*#__PURE__*/ function() {
"use strict";
function Base() {
@@ -26,6 +23,13 @@ export var Base = /*#__PURE__*/ function() {
};
return Base;
}();
+// @filename: argument.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _create_class from "@swc/helpers/src/_create_class.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import regeneratorRuntime from "regenerator-runtime";
+import { Base } from "./base.js";
export var Argument = /*#__PURE__*/ function(Base) {
"use strict";
_inherits(Argument, Base);
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.2.minified.js
index c7042808cf95..c24a77275633 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassAccessor_es5.2.minified.js
@@ -1,8 +1,5 @@
+export { };
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _create_class from "@swc/helpers/src/_create_class.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
-import regeneratorRuntime from "regenerator-runtime";
export var Base = function() {
"use strict";
function Base() {
@@ -16,6 +13,12 @@ export var Base = function() {
};
}, Base;
}();
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _create_class from "@swc/helpers/src/_create_class.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import regeneratorRuntime from "regenerator-runtime";
+import { Base } from "./base.js";
export var Argument = function(Base) {
"use strict";
_inherits(Argument, Base);
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es2015.2.minified.js
index d82269664036..e792f34c3970 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es2015.2.minified.js
@@ -1,6 +1,5 @@
-class Bar {
-}
-module.exports = Bar;
+module.exports = class {
+};
const Bar = require("./bar");
module.exports = class extends Bar {
}, module.exports.Strings = {
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.1.normal.js
index 158ed2a55a97..a13b66dca776 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.1.normal.js
@@ -5,14 +5,15 @@
// @declaration: true
// @filename: bar.js
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
var Bar = function Bar() {
"use strict";
_class_call_check(this, Bar);
};
module.exports = Bar;
// @filename: cls.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var Bar = require("./bar");
var Strings = {
a: "A",
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.2.minified.js
index 08aa054d4bcd..eea55c9d3a8a 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassExtendsVisibility_es5.2.minified.js
@@ -1,12 +1,13 @@
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
var Bar = function() {
"use strict";
_class_call_check(this, Bar);
};
module.exports = Bar;
-var Bar = require("./bar"), Foo = function(Bar) {
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var Foo = function(Bar) {
"use strict";
_inherits(Foo, Bar);
var _super = _create_super(Foo);
@@ -14,7 +15,7 @@ var Bar = require("./bar"), Foo = function(Bar) {
return _class_call_check(this, Foo), _super.apply(this, arguments);
}
return Foo;
-}(Bar);
+}(require("./bar"));
module.exports = Foo, module.exports.Strings = {
a: "A",
b: "B"
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es2015.1.normal.js
index 844a074f22da..6fb9fcc826de 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es2015.1.normal.js
@@ -4,6 +4,7 @@
// @outDir: ./out
// @declaration: true
// @filename: interface.ts
+export { };
// @filename: lib.js
/**
* @template T
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es2015.2.minified.js
index daaf2f4e07f1..9abbfa745803 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es2015.2.minified.js
@@ -1,3 +1,4 @@
+export { };
export class Encoder {
encode(value) {
return new Uint8Array(0);
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es5.1.normal.js
index 83ac2e730d7e..50ed3119d677 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es5.1.normal.js
@@ -4,12 +4,13 @@
// @outDir: ./out
// @declaration: true
// @filename: interface.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+export { };
// @filename: lib.js
/**
* @template T
* @implements {IEncoder}
- */ export var Encoder = /*#__PURE__*/ function() {
+ */ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+export var Encoder = /*#__PURE__*/ function() {
"use strict";
function Encoder() {
_class_call_check(this, Encoder);
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es5.2.minified.js
index 0b463797969d..3eac85c64ce7 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsClassImplementsGenericsSerialization_es5.2.minified.js
@@ -1,3 +1,4 @@
+export { };
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var Encoder = function() {
"use strict";
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath_es2015.2.minified.js
index f5763e4b23af..8a90abee1230 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath_es2015.2.minified.js
@@ -1,9 +1,9 @@
'use strict';
-class Thing {
-}
module.exports = {
- Thing
+ Thing: class {
+ }
};
+'use strict';
const Thing = require('./thing').Thing;
module.exports = {
Thing
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath_es5.2.minified.js
index 0c2bed574985..a2ae3d6352db 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsCommonjsRelativePath_es5.2.minified.js
@@ -6,6 +6,7 @@ var Thing = function() {
module.exports = {
Thing: Thing
};
+"use strict";
var Thing = require("./thing").Thing;
module.exports = {
Thing: Thing
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es2015.2.minified.js
index ebdfefaa79c1..1359c6e59a77 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es2015.2.minified.js
@@ -1,4 +1,4 @@
-let TopLevelSym = Symbol(), InnerSym = Symbol();
+const TopLevelSym = Symbol(), InnerSym = Symbol();
module.exports = {
[TopLevelSym]: (x = 12)=>x,
items: {
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.1.normal.js
index 7edb2f23a759..0bd649c294c9 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.1.normal.js
@@ -5,7 +5,6 @@
// @outDir: ./out
// @declaration: true
// @filename: index.js
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _define_property from "@swc/helpers/src/_define_property.mjs";
var TopLevelSym = Symbol();
var InnerSym = Symbol();
@@ -20,6 +19,7 @@ module.exports = (_obj = {}, _define_property(_obj, TopLevelSym, function() {
return arg.x;
})), _obj);
// @filename: index2.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var TopLevelSym = Symbol();
var InnerSym = Symbol();
var _InnerSym = InnerSym;
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.2.minified.js
index 9a4f98fb2a08..98ceb3a1bc59 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsComputedNames_es5.2.minified.js
@@ -1,4 +1,3 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _define_property from "@swc/helpers/src/_define_property.mjs";
var _obj, TopLevelSym = Symbol(), InnerSym = Symbol();
module.exports = (_define_property(_obj = {}, TopLevelSym, function() {
@@ -10,6 +9,7 @@ module.exports = (_define_property(_obj = {}, TopLevelSym, function() {
};
return arg.x;
})), _obj);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var TopLevelSym = Symbol(), InnerSym = Symbol(), _InnerSym = InnerSym;
export var MyClass = function() {
"use strict";
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es2015.2.minified.js
index b75d48e13a08..a8021c15ed6f 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsCrossfileMerge_es2015.2.minified.js
@@ -1,3 +1,3 @@
-let m = require("./exporter");
+const m = require("./exporter");
module.exports = m.default, module.exports.memberName = "thing";
export default function() {};
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.1.normal.js
index fcaba39aeeb2..27132bf21a81 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.1.normal.js
@@ -11,12 +11,12 @@ export default function foo() {
};
export const x = foo;
export { foo as bar };
+// @filename: index3.js
class Foo {
constructor(){
this.a = /** @type {Foo} */ (null);
}
}
-// @filename: index3.js
export { Foo as default };
export const X = Foo;
export { Foo as Bar };
@@ -31,10 +31,10 @@ class Bar extends Fab {
export default Bar;
// @filename: index5.js
// merge type alias and const (OK)
-export default 12;
-/**
+export default 12; /**
* @typedef {string | number} default
- */ // @filename: index6.js
+ */
+// @filename: index6.js
// merge type alias and function (OK)
export default function func() {};
/**
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.2.minified.js
index b9d25fce0968..a36fca8f86ad 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es2015.2.minified.js
@@ -3,12 +3,14 @@ export default function foo() {
return foo;
};
export const x = foo;
+export { foo as bar };
class Foo {
constructor(){
this.a = null;
}
}
export const X = Foo;
+export { Foo as default, Foo as Bar };
import Fab from "./index3";
export default class extends Fab {
constructor(...args){
@@ -17,4 +19,3 @@ export default class extends Fab {
};
export default 12;
export default function func() {};
-export { foo as bar, Foo as default, Foo as Bar };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.1.normal.js
index 0a4732e13afb..38eb4c7b66d9 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.1.normal.js
@@ -4,9 +4,6 @@
// @outDir: ./out
// @declaration: true
// @filename: index1.js
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
export default 12;
// @filename: index2.js
export default function foo() {
@@ -14,16 +11,20 @@ export default function foo() {
};
export var x = foo;
export { foo as bar };
+// @filename: index3.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Foo = function Foo() {
"use strict";
_class_call_check(this, Foo);
this.a = /** @type {Foo} */ (null);
};
-// @filename: index3.js
export { Foo as default };
export var X = Foo;
export { Foo as Bar };
// @filename: index4.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
import Fab from "./index3";
var Bar = /*#__PURE__*/ function(Fab) {
"use strict";
@@ -41,10 +42,10 @@ var Bar = /*#__PURE__*/ function(Fab) {
export default Bar;
// @filename: index5.js
// merge type alias and const (OK)
-export default 12;
-/**
+export default 12; /**
* @typedef {string | number} default
- */ // @filename: index6.js
+ */
+// @filename: index6.js
// merge type alias and function (OK)
export default function func() {};
/**
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.2.minified.js
index 938aba1efc48..0f26cc15c427 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsDefault_es5.2.minified.js
@@ -1,16 +1,19 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
export default 12;
export default function foo() {
return foo;
};
export var x = foo;
+export { foo as bar };
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Foo = function() {
"use strict";
_class_call_check(this, Foo), this.a = null;
};
export var X = Foo;
+export { Foo as default, Foo as Bar };
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
import Fab from "./index3";
var Bar = function(Fab) {
"use strict";
@@ -25,4 +28,3 @@ var Bar = function(Fab) {
export default Bar;
export default 12;
export default function func() {};
-export { foo as bar, Foo as default, Foo as Bar };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es2015.1.normal.js
index c0691bd69b5f..cd2cbc3a1a0b 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es2015.1.normal.js
@@ -11,15 +11,14 @@ class Cls {
}
}
Cls.y = "ok";
-export default Cls;
-class C {
-}
-/**
+export default Cls; /**
* @typedef {string | number} default
- */ // @filename: index2.js
+ */
+// @filename: index2.js
// merge type alias and class (error message improvement needed, see #32368)
-export { C as default };
-/**
+export default class C {
+};
+ /**
* @typedef {string | number} default
*/ // @filename: index3.js
// merge type alias and variable (behavior is borked, see #32366)
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es2015.2.minified.js
index 3386b07b070e..a43b17441fa5 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es2015.2.minified.js
@@ -5,7 +5,7 @@ class Cls {
}
Cls.y = "ok";
export default Cls;
-class C {
-}
+export default class C {
+};
let x = 12;
-export { C as default, x as default };
+export { x as default };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es5.1.normal.js
index 3766e7b50fcd..fdab54f5fbea 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es5.1.normal.js
@@ -12,17 +12,18 @@ var Cls = function Cls() {
this.x = 12;
};
Cls.y = "ok";
-export default Cls;
+export default Cls; /**
+ * @typedef {string | number} default
+ */
+// @filename: index2.js
+// merge type alias and class (error message improvement needed, see #32368)
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var C = function C() {
"use strict";
_class_call_check(this, C);
};
-/**
- * @typedef {string | number} default
- */ // @filename: index2.js
-// merge type alias and class (error message improvement needed, see #32368)
export { C as default };
-/**
+ /**
* @typedef {string | number} default
*/ // @filename: index3.js
// merge type alias and variable (behavior is borked, see #32366)
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es5.2.minified.js
index 04fd1ebd2f70..0da8998d2a82 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsDefaultsErr_es5.2.minified.js
@@ -5,9 +5,11 @@ var Cls = function() {
};
Cls.y = "ok";
export default Cls;
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var C = function() {
"use strict";
_class_call_check(this, C);
};
+export { C as default };
var x = 12;
-export { C as default, x as default };
+export { x as default };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedVisibility_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedVisibility_es5.1.normal.js
index 28ba8207b2e6..1ce06a50a33c 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedVisibility_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedVisibility_es5.1.normal.js
@@ -11,6 +11,7 @@ module.exports = function Obj() {
this.x = 12;
};
// @filename: index.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Obj = require("./obj");
var Container = function Container() {
"use strict";
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedVisibility_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedVisibility_es5.2.minified.js
index 734e272c17e3..dc150563b9e8 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedVisibility_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsExportAssignedVisibility_es5.2.minified.js
@@ -3,6 +3,7 @@ module.exports = function Obj() {
"use strict";
_class_call_check(this, Obj), this.x = 12;
};
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Obj = require("./obj"), Container = function() {
"use strict";
_class_call_check(this, Container), this.usage = new Obj();
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.1.normal.js
index fb2db7872ef3..19f5d0ee8603 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.1.normal.js
@@ -13,9 +13,17 @@ export * from "./cls";
// @filename: bar2.js
export * from "./func";
export * from "./cls";
+// @filename: baz.js
+import { Foo } from "./cls";
export { Foo };
+// @filename: bat.js
+import * as ns from "./cls";
export default ns;
+// @filename: ban.js
+import * as ns from "./cls";
export { ns };
+// @filename: bol.js
+import * as ns from "./cls";
export { ns as classContainer };
// @filename: cjs.js
const ns = require("./cls");
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.2.minified.js
index 159bc2caa10b..8b17e1c9d4f3 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es2015.2.minified.js
@@ -4,16 +4,23 @@ export function func() {}
export * from "./cls";
export * from "./func";
export * from "./cls";
+import { Foo } from "./cls";
+export { Foo };
+import * as ns from "./cls";
export default ns;
-let ns = require("./cls");
+import * as ns from "./cls";
+export { ns };
+import * as ns from "./cls";
+export { ns as classContainer };
+const ns = require("./cls");
module.exports = {
ns
};
-let ns = require("./cls");
+const ns = require("./cls");
module.exports = ns;
-let ns = require("./cls");
+const ns = require("./cls");
module.exports.ns = ns;
-let ns = require("./cls");
+const ns = require("./cls");
module.exports.names = ns;
import "./cjs4";
import "./cjs3";
@@ -25,4 +32,3 @@ import "./bat";
import "./baz";
import "./bar";
import "./bar2";
-export { Foo, ns, ns as classContainer };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.1.normal.js
index b05c4aade42c..282c1544897b 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.1.normal.js
@@ -16,9 +16,17 @@ export * from "./cls";
// @filename: bar2.js
export * from "./func";
export * from "./cls";
+// @filename: baz.js
+import { Foo } from "./cls";
export { Foo };
+// @filename: bat.js
+import * as ns from "./cls";
export default ns;
+// @filename: ban.js
+import * as ns from "./cls";
export { ns };
+// @filename: bol.js
+import * as ns from "./cls";
export { ns as classContainer };
// @filename: cjs.js
var ns = require("./cls");
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.2.minified.js
index ffc570543c74..12e3888460f7 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsExportForms_es5.2.minified.js
@@ -7,7 +7,14 @@ export function func() {}
export * from "./cls";
export * from "./func";
export * from "./cls";
+import { Foo } from "./cls";
+export { Foo };
+import * as ns from "./cls";
export default ns;
+import * as ns from "./cls";
+export { ns };
+import * as ns from "./cls";
+export { ns as classContainer };
var ns = require("./cls");
module.exports = {
ns: ns
@@ -28,4 +35,3 @@ import "./bat";
import "./baz";
import "./bar";
import "./bar2";
-export { Foo, ns, ns as classContainer };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionClassesCjsExportAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionClassesCjsExportAssignment_es2015.2.minified.js
index f4102cf532ab..b259ca19d893 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionClassesCjsExportAssignment_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionClassesCjsExportAssignment_es2015.2.minified.js
@@ -1,11 +1,13 @@
+module.exports = function(timeout) {
+ this.timeout = timeout;
+};
+module.exports = function(handle) {
+ this.handle = handle;
+};
function Context(input) {
if (!(this instanceof Context)) return new Context(input);
this.state = this.construct(input);
}
-module.exports = function(timeout) {
- this.timeout = timeout;
-}, module.exports = function(handle) {
- this.handle = handle;
-}, Context.prototype = {
+Context.prototype = {
construct: (input, handle = ()=>void 0)=>input
}, module.exports = Context;
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionClassesCjsExportAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionClassesCjsExportAssignment_es5.1.normal.js
index 197fb281ed90..d3a61173f209 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionClassesCjsExportAssignment_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionClassesCjsExportAssignment_es5.1.normal.js
@@ -6,8 +6,7 @@
// @filename: timer.js
/**
* @param {number} timeout
- */ import _instanceof from "@swc/helpers/src/_instanceof.mjs";
-function Timer(timeout) {
+ */ function Timer(timeout) {
this.timeout = timeout;
}
module.exports = Timer;
@@ -44,7 +43,8 @@ module.exports = Hook;
*
* @class
* @param {Input} input
- */ function Context(input) {
+ */ import _instanceof from "@swc/helpers/src/_instanceof.mjs";
+function Context(input) {
if (!_instanceof(this, Context)) {
return new Context(input);
}
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionClassesCjsExportAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionClassesCjsExportAssignment_es5.2.minified.js
index 4bb5d140c9ca..5187b0e00e81 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionClassesCjsExportAssignment_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionClassesCjsExportAssignment_es5.2.minified.js
@@ -1,13 +1,15 @@
+module.exports = function(timeout) {
+ this.timeout = timeout;
+};
+module.exports = function(handle) {
+ this.handle = handle;
+};
import _instanceof from "@swc/helpers/src/_instanceof.mjs";
function Context(input) {
if (!_instanceof(this, Context)) return new Context(input);
this.state = this.construct(input);
}
-module.exports = function(timeout) {
- this.timeout = timeout;
-}, module.exports = function(handle) {
- this.handle = handle;
-}, Context.prototype = {
+Context.prototype = {
construct: function(input) {
return arguments.length > 1 && void 0 !== arguments[1] && arguments[1], input;
}
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es2015.1.normal.js
index 42607a87d69c..447d38e08975 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es2015.1.normal.js
@@ -62,4 +62,6 @@ Point2D.prototype = {
this.storage[1] = y;
}
};
+// @filename: referencer.js
+import { Point2D } from "./source";
export const origin = new Point2D(0, 0); // export const res = Point2D(2, 3).dot(origin); // TODO: when __proto__ works, validate this
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es2015.2.minified.js
index 09cf15aa3436..ffa987cd364b 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es2015.2.minified.js
@@ -33,4 +33,5 @@ Point2D.prototype = {
this.storage[1] = y;
}
};
+import { Point2D } from "./source";
export const origin = new Point2D(0, 0);
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es5.1.normal.js
index 791c4a534300..2208bbc60431 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es5.1.normal.js
@@ -63,4 +63,6 @@ Point2D.prototype = {
this.storage[1] = y;
}
};
+// @filename: referencer.js
+import { Point2D } from "./source";
export var origin = new Point2D(0, 0); // export const res = Point2D(2, 3).dot(origin); // TODO: when __proto__ works, validate this
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es5.2.minified.js
index a79b9970801d..cf5b2d278f08 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses2_es5.2.minified.js
@@ -32,4 +32,5 @@ Point2D.prototype = {
this.storage[1] = y;
}
};
+import { Point2D } from "./source";
export var origin = new Point2D(0, 0);
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses_es2015.1.normal.js
index 7c03087a4052..5a8c9459d6f3 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses_es2015.1.normal.js
@@ -14,6 +14,7 @@
this.x = x;
this.y = y;
}
+// @filename: referencer.js
/**
* @param {Point} p
*/ export function magnitude(p) {
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses_es5.1.normal.js
index 9822473974f1..268f989eb7df 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsFunctionLikeClasses_es5.1.normal.js
@@ -15,6 +15,7 @@ export function Point(x, y) {
this.x = x;
this.y = y;
}
+// @filename: referencer.js
/**
* @param {Point} p
*/ export function magnitude(p) {
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es2015.2.minified.js
index 0f10cacdaf16..16a6667b36f9 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es2015.2.minified.js
@@ -1,5 +1,4 @@
-const myTypes = {};
-exports.myTypes = myTypes;
+exports.myTypes = {};
const { myTypes } = require('./file.js');
module.exports = {
testFn: function(input) {
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es5.2.minified.js
index 2ab1e0984309..2f91a7d09a9c 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespaceCjs_es5.2.minified.js
@@ -1,7 +1,5 @@
-var myTypes = {};
-exports.myTypes = myTypes;
-var myTypes = require("./file.js").myTypes;
-module.exports = {
+exports.myTypes = {};
+require("./file.js").myTypes, module.exports = {
testFn: function(input) {
return "number" == typeof input ? 2 * input : null;
},
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es2015.1.normal.js
index c264b83d25a5..ca650b18cb5f 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es2015.1.normal.js
@@ -16,6 +16,7 @@
* @property {myTypes.typeA} prop1 - Prop 1.
* @property {string} prop2 - Prop 2.
*/ /** @typedef {myTypes.typeB|Function} myTypes.typeC */ export { myTypes };
+// @filename: file2.js
/**
* @namespace testFnTypes
* @global
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es2015.2.minified.js
index 0accc7c28202..3d39ab4ee1ed 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es2015.2.minified.js
@@ -1,6 +1,7 @@
let myTypes = {};
+export { myTypes };
let testFnTypes = {};
function testFn(input) {
return 'number' == typeof input ? 2 * input : null;
}
-export { myTypes, testFn, testFnTypes };
+export { testFn, testFnTypes };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es5.1.normal.js
index d2e60d41180d..bf2e568318ee 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es5.1.normal.js
@@ -16,6 +16,7 @@
* @property {myTypes.typeA} prop1 - Prop 1.
* @property {string} prop2 - Prop 2.
*/ /** @typedef {myTypes.typeB|Function} myTypes.typeC */ export { myTypes };
+// @filename: file2.js
/**
* @namespace testFnTypes
* @global
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es5.2.minified.js
index be8961ba6ac4..8aa6e9c53b11 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsImportAliasExposedWithinNamespace_es5.2.minified.js
@@ -1,6 +1,7 @@
var myTypes = {};
+export { myTypes };
var testFnTypes = {};
function testFn(input) {
return "number" == typeof input ? 2 * input : null;
}
-export { myTypes, testFn, testFnTypes };
+export { testFn, testFnTypes };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es2015.1.normal.js
index e1f911e69cb3..18132b76c642 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es2015.1.normal.js
@@ -3,5 +3,6 @@
// @checkJs: true
// @filename: file.js
/** @type {import('./mod1').Dotted.Name} - should work */ var dot2;
+export { };
// @filename: mod1.js
/** @typedef {number} Dotted.Name */ export var dummy = 1;
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es2015.2.minified.js
index 83c4fb71fe0b..f79371e2e4bf 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es2015.2.minified.js
@@ -1 +1,2 @@
+export { };
export var dummy = 1;
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es5.1.normal.js
index e1f911e69cb3..18132b76c642 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es5.1.normal.js
@@ -3,5 +3,6 @@
// @checkJs: true
// @filename: file.js
/** @type {import('./mod1').Dotted.Name} - should work */ var dot2;
+export { };
// @filename: mod1.js
/** @typedef {number} Dotted.Name */ export var dummy = 1;
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es5.2.minified.js
index 83c4fb71fe0b..f79371e2e4bf 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsImportNamespacedType_es5.2.minified.js
@@ -1 +1,2 @@
+export { };
export var dummy = 1;
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsImportTypeBundled_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsImportTypeBundled_es2015.2.minified.js
index 96ad9650cdeb..555b1ff31356 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsImportTypeBundled_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsImportTypeBundled_es2015.2.minified.js
@@ -1,6 +1,7 @@
module.exports = {
x: 12
-}, module.exports = [
+};
+module.exports = [
{
x: 12
}
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsImportTypeBundled_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsImportTypeBundled_es5.2.minified.js
index 96ad9650cdeb..555b1ff31356 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsImportTypeBundled_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsImportTypeBundled_es5.2.minified.js
@@ -1,6 +1,7 @@
module.exports = {
x: 12
-}, module.exports = [
+};
+module.exports = [
{
x: 12
}
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsReexportAliases_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsReexportAliases_es5.2.minified.js
index 6a37ef986d09..2e296518f89f 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsReexportAliases_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsReexportAliases_es5.2.minified.js
@@ -3,7 +3,7 @@ var Foo = function() {
"use strict";
_class_call_check(this, Foo);
};
+export { Foo as default };
import { default as Fooa } from "./cls";
export var x = new Fooa();
export { default as Foob } from "./cls";
-export { Foo as default };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile_es2015.2.minified.js
index 0b2f5cf01fac..51241cb7fd2f 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile_es2015.2.minified.js
@@ -1,23 +1,21 @@
-class Rectangle {
- constructor(){
- console.log("I'm a rectangle!");
- }
-}
module.exports = {
- Rectangle
+ Rectangle: class {
+ constructor(){
+ console.log("I'm a rectangle!");
+ }
+ }
};
const { Rectangle } = require('./rectangle');
-class Render {
- addRectangle() {
- let obj = new Rectangle();
- return this.objects.push(obj), obj;
- }
- constructor(){
- this.objects = [];
- }
-}
module.exports = {
- Render
+ Render: class {
+ addRectangle() {
+ let obj = new Rectangle();
+ return this.objects.push(obj), obj;
+ }
+ constructor(){
+ this.objects = [];
+ }
+ }
};
const { Render } = require("./index");
let render = new Render();
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile_es5.1.normal.js
index 57a1c57bc2ee..83879a492c93 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile_es5.1.normal.js
@@ -14,6 +14,7 @@ module.exports = {
Rectangle: Rectangle
};
// @filename: index.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Rectangle = require("./rectangle").Rectangle;
var Render = /*#__PURE__*/ function() {
"use strict";
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile_es5.2.minified.js
index 56c1400e2bbd..483953fd00bb 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsReferenceToClassInstanceCrossFile_es5.2.minified.js
@@ -6,6 +6,7 @@ var Rectangle = function() {
module.exports = {
Rectangle: Rectangle
};
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Rectangle = require("./rectangle").Rectangle, Render = function() {
"use strict";
function Render() {
@@ -19,5 +20,5 @@ var Rectangle = require("./rectangle").Rectangle, Render = function() {
module.exports = {
Render: Render
};
-var Render = require("./index").Render, render = new Render();
+var render = new (require("./index")).Render();
render.addRectangle(), console.log("Objects", render.objects);
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es2015.1.normal.js
index c29da76d5ac9..415eaf5fe18a 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es2015.1.normal.js
@@ -3,25 +3,27 @@
// @outDir: ./out
// @declaration: true
// @filename: index.js
-/**
+export { }; // flag file as module
+ /**
* @typedef {string | number | symbol} PropName
- */ /**
+ */ /**
* Callback
*
* @callback NumberToStringCb
* @param {number} a
* @returns {string}
- */ /**
+ */ /**
* @template T
* @typedef {T & {name: string}} MixinName
- */ /**
+ */ /**
* Identity function
*
* @template T
* @callback Identity
* @param {T} x
* @returns {T}
- */ // @filename: mixed.js
+ */
+// @filename: mixed.js
/**
* @typedef {{x: string} | number | LocalThing | ExportedThing} SomeType
*/ /**
@@ -46,4 +48,3 @@ class LocalThing {
this.y = "ok";
}
}
-export { };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es2015.2.minified.js
index b62dd801a77b..c0c4ea70d164 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es2015.2.minified.js
@@ -1,3 +1,4 @@
+export { };
module.exports = {
doTheThing: function(x) {
return {
@@ -10,4 +11,3 @@ module.exports = {
}
}
};
-export { };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es5.1.normal.js
index d7de74e4ac45..5501211a6dfc 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es5.1.normal.js
@@ -3,32 +3,34 @@
// @outDir: ./out
// @declaration: true
// @filename: index.js
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-/**
+export { }; // flag file as module
+ /**
* @typedef {string | number | symbol} PropName
- */ /**
+ */ /**
* Callback
*
* @callback NumberToStringCb
* @param {number} a
* @returns {string}
- */ /**
+ */ /**
* @template T
* @typedef {T & {name: string}} MixinName
- */ /**
+ */ /**
* Identity function
*
* @template T
* @callback Identity
* @param {T} x
* @returns {T}
- */ // @filename: mixed.js
+ */
+// @filename: mixed.js
/**
* @typedef {{x: string} | number | LocalThing | ExportedThing} SomeType
*/ /**
* @param {number} x
* @returns {SomeType}
- */ function doTheThing(x) {
+ */ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+function doTheThing(x) {
return {
x: "" + x
};
@@ -47,4 +49,3 @@ var LocalThing = function LocalThing() {
_class_call_check(this, LocalThing);
this.y = "ok";
};
-export { };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es5.2.minified.js
index e22eacbbedf8..db6d30e3003a 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeAliases_es5.2.minified.js
@@ -1,3 +1,4 @@
+export { };
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var ExportedThing = function() {
"use strict";
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es2015.1.normal.js
index fbe1a3dfa678..f0f551150256 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es2015.1.normal.js
@@ -4,8 +4,8 @@
// @lib: es6
// @declaration: true
// @filename: some-mod.d.ts
+module.exports = getItems;
+export { };
// @filename: index.js
const items = require("./some-mod")();
module.exports = items;
-module.exports = getItems;
-export { };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es2015.2.minified.js
index 5612c81b5d68..e526d1aeadce 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es2015.2.minified.js
@@ -1,3 +1,4 @@
-let items = require("./some-mod")();
-module.exports = items, module.exports = getItems;
+module.exports = getItems;
export { };
+const items = require("./some-mod")();
+module.exports = items;
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es5.1.normal.js
index 055bca1e3fab..7bbd816f56f4 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es5.1.normal.js
@@ -4,8 +4,8 @@
// @lib: es6
// @declaration: true
// @filename: some-mod.d.ts
+module.exports = getItems;
+export { };
// @filename: index.js
var items = require("./some-mod")();
module.exports = items;
-module.exports = getItems;
-export { };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es5.2.minified.js
index b6938b11ee32..edc5cfa43092 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration2_es5.2.minified.js
@@ -1,3 +1,4 @@
-var items = require("./some-mod")();
-module.exports = items, module.exports = getItems;
+module.exports = getItems;
export { };
+var items = require("./some-mod")();
+module.exports = items;
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es2015.1.normal.js
index 9967e7a74f40..eb499b9bcc10 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es2015.1.normal.js
@@ -4,8 +4,8 @@
// @lib: es6
// @declaration: true
// @filename: /some-mod.d.ts
+module.exports = items;
+export { };
// @filename: index.js
/** @type {typeof import("/some-mod")} */ const items = [];
module.exports = items;
-module.exports = items;
-export { };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es2015.2.minified.js
index c39611977e04..0570dcb038f1 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es2015.2.minified.js
@@ -1,3 +1,3 @@
-let items = [];
-module.exports = items, module.exports = items;
+module.exports = items;
export { };
+module.exports = [];
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es5.1.normal.js
index 5882a7dbaac6..6ef1fe373fcf 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es5.1.normal.js
@@ -4,8 +4,8 @@
// @lib: es6
// @declaration: true
// @filename: /some-mod.d.ts
+module.exports = items;
+export { };
// @filename: index.js
/** @type {typeof import("/some-mod")} */ var items = [];
module.exports = items;
-module.exports = items;
-export { };
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es5.2.minified.js
index cb0674968ab4..0570dcb038f1 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReassignmentFromDeclaration_es5.2.minified.js
@@ -1,3 +1,3 @@
-var items = [];
-module.exports = items, module.exports = items;
+module.exports = items;
export { };
+module.exports = [];
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences2_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences2_es2015.2.minified.js
index 124b2199080f..61af91173b14 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypeReferences2_es2015.2.minified.js
@@ -2,7 +2,7 @@ export const o = {
a: 1,
m: 1
};
-let { a , m } = require("./something").o;
+const { a , m } = require("./something").o;
module.exports = {
thing: a + m
};
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es2015.2.minified.js
index f097b9787610..90a4fc02dce9 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es2015.2.minified.js
@@ -3,7 +3,8 @@ module.exports = class {
constructor(){
this.item = 3;
}
-}, module.exports = {
+};
+module.exports = {
Wrap: class {
constructor(c){
this.connItem = c.item, this.another = "";
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.1.normal.js
index 5d0b4aab3aaa..301cedb495dd 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.1.normal.js
@@ -20,7 +20,8 @@ module.exports = Conn;
// @filename: usage.js
/**
* @typedef {import("./conn")} Conn
- */ var Wrap = function Wrap(c) {
+ */ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+var Wrap = function Wrap(c) {
"use strict";
_class_call_check(this, Wrap);
this.connItem = c.item;
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.2.minified.js
index 1d6c83fe7682..9b9b02b475b8 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefAndImportTypes_es5.2.minified.js
@@ -7,6 +7,7 @@ var Conn = function() {
return Conn.prototype.method = function() {}, Conn;
}();
module.exports = Conn;
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Wrap = function(c) {
"use strict";
_class_call_check(this, Wrap), this.connItem = c.item, this.another = "";
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es2015.2.minified.js
index 2c04b6e8c401..088c784ce465 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es2015.2.minified.js
@@ -1,16 +1,15 @@
-const taskGroups = {
- parseHTML: {
- id: 'parseHTML',
- label: 'Parse HTML & CSS'
- },
- styleLayout: {
- id: 'styleLayout',
- label: 'Style & Layout'
- }
-}, taskNameToGroup = {};
module.exports = {
- taskGroups,
- taskNameToGroup
+ taskGroups: {
+ parseHTML: {
+ id: 'parseHTML',
+ label: 'Parse HTML & CSS'
+ },
+ styleLayout: {
+ id: 'styleLayout',
+ label: 'Style & Layout'
+ }
+ },
+ taskNameToGroup: {}
};
const { taskGroups , taskNameToGroup } = require('./module.js');
module.exports = class {
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.1.normal.js
index 4f229e71ffe9..03f19ef98843 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.1.normal.js
@@ -11,8 +11,7 @@
* @property {string[]} traceEventNames
*/ /**
* @type {{[P in TaskGroupIds]: {id: P, label: string}}}
- */ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var taskGroups = {
+ */ var taskGroups = {
parseHTML: {
id: "parseHTML",
label: "Parse HTML & CSS"
@@ -28,6 +27,7 @@ module.exports = {
taskNameToGroup: taskNameToGroup
};
// @filename: index.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var ref = require("./module.js"), taskGroups = ref.taskGroups, taskNameToGroup = ref.taskNameToGroup;
/** @typedef {import('./module.js').TaskGroup} TaskGroup */ /**
* @typedef TaskNode
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.2.minified.js
index c704c4330a3c..c08b02f19b38 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefPropertyAndExportAssignment_es5.2.minified.js
@@ -1,19 +1,20 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var taskGroups = {
- parseHTML: {
- id: "parseHTML",
- label: "Parse HTML & CSS"
- },
- styleLayout: {
- id: "styleLayout",
- label: "Style & Layout"
- }
-}, taskNameToGroup = {};
module.exports = {
- taskGroups: taskGroups,
- taskNameToGroup: taskNameToGroup
+ taskGroups: {
+ parseHTML: {
+ id: "parseHTML",
+ label: "Parse HTML & CSS"
+ },
+ styleLayout: {
+ id: "styleLayout",
+ label: "Style & Layout"
+ }
+ },
+ taskNameToGroup: {}
};
-var ref = require("./module.js"), taskGroups = ref.taskGroups, taskNameToGroup = ref.taskNameToGroup, MainThreadTasks = function(x, y) {
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+var ref = require("./module.js");
+ref.taskGroups, ref.taskNameToGroup;
+var MainThreadTasks = function(x, y) {
"use strict";
_class_call_check(this, MainThreadTasks);
};
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsUniqueSymbolUsage_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsUniqueSymbolUsage_es2015.1.normal.js
index 00f98d8856a3..b52b17c047bb 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsUniqueSymbolUsage_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsUniqueSymbolUsage_es2015.1.normal.js
@@ -4,10 +4,10 @@
// @emitDeclarationOnly: true
// @lib: es2017
// @filename: a.js
-export const kSymbol = Symbol("my-symbol");
-/**
+export const kSymbol = Symbol("my-symbol"); /**
* @typedef {{[kSymbol]: true}} WithSymbol
- */ // @filename: b.js
+ */
+// @filename: b.js
/**
* @returns {import('./a').WithSymbol}
* @param {import('./a').WithSymbol} value
diff --git a/crates/swc/tests/tsc-references/jsDeclarationsUniqueSymbolUsage_es5.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsUniqueSymbolUsage_es5.1.normal.js
index daf5b4361d64..6e1b4fabae6d 100644
--- a/crates/swc/tests/tsc-references/jsDeclarationsUniqueSymbolUsage_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsDeclarationsUniqueSymbolUsage_es5.1.normal.js
@@ -4,10 +4,10 @@
// @emitDeclarationOnly: true
// @lib: es2017
// @filename: a.js
-export var kSymbol = Symbol("my-symbol");
-/**
+export var kSymbol = Symbol("my-symbol"); /**
* @typedef {{[kSymbol]: true}} WithSymbol
- */ // @filename: b.js
+ */
+// @filename: b.js
/**
* @returns {import('./a').WithSymbol}
* @param {import('./a').WithSymbol} value
diff --git a/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es2015.2.minified.js
index 7823c58779dd..ccecfab35454 100644
--- a/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es2015.2.minified.js
@@ -1,15 +1,2 @@
-var variable = {};
-variable.a = 0;
-class C {
- constructor(){
- this.initializedMember = {}, this.member = {}, this.member.a = 0;
- }
-}
-var obj = {
- property: {}
-};
-obj.property.a = 0;
-var arr = [
- {}
-];
-variable.a = 1, new C().member.a = 1, new C().initializedMember.a = 1, obj.property.a = 1, arr[0].a = 1, ({}).a = 1;
+({}).a = 0, ({}).a = 0;
+variable.a = 1, new C().member.a = 1, new C().initializedMember.a = 1, obj.property.a = 1, arr[0].a = 1, getObj().a = 1;
diff --git a/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es5.2.minified.js b/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es5.2.minified.js
index 28b3ca263d39..220eafc89803 100644
--- a/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsObjectsMarkedAsOpenEnded_es5.2.minified.js
@@ -1,14 +1,8 @@
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var variable = {};
-variable.a = 0;
+({}).a = 0;
var C = function() {
"use strict";
_class_call_check(this, C), this.initializedMember = {}, this.member = {}, this.member.a = 0;
-}, obj = {
- property: {}
};
-obj.property.a = 0;
-var arr = [
- {}
-];
-variable.a = 1, new C().member.a = 1, new C().initializedMember.a = 1, obj.property.a = 1, arr[0].a = 1, ({}).a = 1;
+({}).a = 0;
+variable.a = 1, new C().member.a = 1, new C().initializedMember.a = 1, obj.property.a = 1, arr[0].a = 1, getObj().a = 1;
diff --git a/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es2015.1.normal.js
index b2b76c490eaf..666d46a416c9 100644
--- a/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es2015.1.normal.js
@@ -7,6 +7,8 @@
// @checkJs: true
// @filename: component.d.ts
import * as React from "react";
+// @filename: file.jsx
+import { MyComp } from "./component";
import * as React from "react";
let x = /*#__PURE__*/ React.createElement(MyComp, {
a: 10,
diff --git a/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es2015.2.minified.js
index 8fe5a150721a..0b6766011874 100644
--- a/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es2015.2.minified.js
@@ -1,2 +1,3 @@
import * as React from "react";
+import { MyComp } from "./component";
import * as React from "react";
diff --git a/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es5.1.normal.js b/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es5.1.normal.js
index 9c76f439475c..757a41683b83 100644
--- a/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es5.1.normal.js
@@ -7,6 +7,8 @@
// @checkJs: true
// @filename: component.d.ts
import * as React from "react";
+// @filename: file.jsx
+import { MyComp } from "./component";
import * as React from "react";
var x = /*#__PURE__*/ React.createElement(MyComp, {
a: 10,
diff --git a/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es5.2.minified.js b/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es5.2.minified.js
index 8fe5a150721a..0b6766011874 100644
--- a/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsxCheckJsxNoTypeArgumentsAllowed_es5.2.minified.js
@@ -1,2 +1,3 @@
import * as React from "react";
+import { MyComp } from "./component";
import * as React from "react";
diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es2015.1.normal.js
index 131fef1c84cc..b3b048265057 100644
--- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es2015.1.normal.js
@@ -13,9 +13,11 @@ const a = /*#__PURE__*/ _jsxs(_Fragment, {
})
]
});
+export { };
// @filename: react.tsx
///
-/* @jsxImportSource react */ import "./preact";
+/* @jsxImportSource react */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
+import "./preact";
const a = /*#__PURE__*/ _jsxs(_Fragment, {
children: [
/*#__PURE__*/ _jsx("p", {}),
diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es2015.2.minified.js
index 9b9967d9bd98..bcb96fb32377 100644
--- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es2015.2.minified.js
@@ -1,2 +1,3 @@
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
+import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import "./preact";
diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es5.1.normal.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es5.1.normal.js
index 21b780b4c2c9..1784630e3f5d 100644
--- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es5.1.normal.js
@@ -13,9 +13,11 @@ var a = /*#__PURE__*/ _jsxs(_Fragment, {
})
]
});
+export { };
// @filename: react.tsx
///
-/* @jsxImportSource react */ import "./preact";
+/* @jsxImportSource react */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
+import "./preact";
var a = /*#__PURE__*/ _jsxs(_Fragment, {
children: [
/*#__PURE__*/ _jsx("p", {}),
diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es5.2.minified.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es5.2.minified.js
index 9b9967d9bd98..bcb96fb32377 100644
--- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformCustomImportPragma_es5.2.minified.js
@@ -1,2 +1,3 @@
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
+import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import "./preact";
diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es2015.1.normal.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es2015.1.normal.js
index 5471c1e6e1d9..3011b1480a47 100644
--- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es2015.1.normal.js
@@ -16,9 +16,14 @@ const a = /*#__PURE__*/ _jsx("div", _object_spread_props(_object_spread({}, prop
const b = /*#__PURE__*/ _createElement("div", _object_spread_props(_object_spread({}, props), {
key: "bar"
}), "text");
+export { };
// @filename: react.tsx
///
-/* @jsxImportSource react */ import "./preact";
+/* @jsxImportSource react */ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
+import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
+import { jsx as _jsx } from "react/jsx-runtime";
+import { createElement as _createElement } from "react";
+import "./preact";
const props2 = {
answer: 42
};
diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es2015.2.minified.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es2015.2.minified.js
index 215821126a7c..47caaad6c62b 100644
--- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es2015.2.minified.js
@@ -10,6 +10,10 @@ _object_spread_props(_object_spread({}, props), {
}), _object_spread_props(_object_spread({}, props), {
key: "bar"
});
+import _object_spread from "@swc/helpers/src/_object_spread.mjs";
+import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
+import { jsx as _jsx } from "react/jsx-runtime";
+import { createElement as _createElement } from "react";
import "./preact";
let props2 = {
answer: 42
diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es5.1.normal.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es5.1.normal.js
index 2431cd2096ea..e2989b13d787 100644
--- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es5.1.normal.js
@@ -16,9 +16,14 @@ var a = /*#__PURE__*/ _jsx("div", _object_spread_props(_object_spread({}, props)
var b = /*#__PURE__*/ _createElement("div", _object_spread_props(_object_spread({}, props), {
key: "bar"
}), "text");
+export { };
// @filename: react.tsx
///
-/* @jsxImportSource react */ import "./preact";
+/* @jsxImportSource react */ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
+import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
+import { jsx as _jsx } from "react/jsx-runtime";
+import { createElement as _createElement } from "react";
+import "./preact";
var props2 = {
answer: 42
};
diff --git a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es5.2.minified.js b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es5.2.minified.js
index 4596a637a6a7..032171634f77 100644
--- a/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/jsxJsxsCjsTransformKeyPropCustomImportPragma_es5.2.minified.js
@@ -10,6 +10,10 @@ _object_spread_props(_object_spread({}, props), {
}), _object_spread_props(_object_spread({}, props), {
key: "bar"
});
+import _object_spread from "@swc/helpers/src/_object_spread.mjs";
+import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
+import { jsx as _jsx } from "react/jsx-runtime";
+import { createElement as _createElement } from "react";
import "./preact";
var props2 = {
answer: 42
diff --git a/crates/swc/tests/tsc-references/letIdentifierInElementAccess01_es2015.1.normal.js b/crates/swc/tests/tsc-references/letIdentifierInElementAccess01_es2015.1.normal.js
new file mode 100644
index 000000000000..12dea49a8efa
--- /dev/null
+++ b/crates/swc/tests/tsc-references/letIdentifierInElementAccess01_es2015.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 1 | var let: any = {};
+//! : ^^^
+//! `----
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | (let[0] = 100);
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/letIdentifierInElementAccess01_es2015.2.minified.js b/crates/swc/tests/tsc-references/letIdentifierInElementAccess01_es2015.2.minified.js
new file mode 100644
index 000000000000..12dea49a8efa
--- /dev/null
+++ b/crates/swc/tests/tsc-references/letIdentifierInElementAccess01_es2015.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 1 | var let: any = {};
+//! : ^^^
+//! `----
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | (let[0] = 100);
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/letIdentifierInElementAccess01_es5.1.normal.js b/crates/swc/tests/tsc-references/letIdentifierInElementAccess01_es5.1.normal.js
new file mode 100644
index 000000000000..12dea49a8efa
--- /dev/null
+++ b/crates/swc/tests/tsc-references/letIdentifierInElementAccess01_es5.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 1 | var let: any = {};
+//! : ^^^
+//! `----
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | (let[0] = 100);
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/letIdentifierInElementAccess01_es5.2.minified.js b/crates/swc/tests/tsc-references/letIdentifierInElementAccess01_es5.2.minified.js
new file mode 100644
index 000000000000..12dea49a8efa
--- /dev/null
+++ b/crates/swc/tests/tsc-references/letIdentifierInElementAccess01_es5.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 1 | var let: any = {};
+//! : ^^^
+//! `----
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 2 | (let[0] = 100);
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es2015.1.normal.js b/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es2015.1.normal.js
index 0e84f4cdacd2..6473502f6b8f 100644
--- a/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es2015.1.normal.js
@@ -6,3 +6,6 @@
// @filename: file1.ts
///
export { };
+// @filename: file2.ts
+///
+export { };
diff --git a/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es2015.2.minified.js b/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es2015.2.minified.js
index 2234b9cae16d..98fdd3114198 100644
--- a/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es2015.2.minified.js
@@ -1 +1,2 @@
export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es5.1.normal.js b/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es5.1.normal.js
index 0e84f4cdacd2..6473502f6b8f 100644
--- a/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es5.1.normal.js
@@ -6,3 +6,6 @@
// @filename: file1.ts
///
export { };
+// @filename: file2.ts
+///
+export { };
diff --git a/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es5.2.minified.js b/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es5.2.minified.js
index 2234b9cae16d..98fdd3114198 100644
--- a/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/libReferenceDeclarationEmitBundle_es5.2.minified.js
@@ -1 +1,2 @@
export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es2015.1.normal.js b/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es2015.1.normal.js
index 6adbcf1f414c..b440e0fb34e0 100644
--- a/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es2015.1.normal.js
@@ -5,3 +5,6 @@
// @filename: file1.ts
///
export { };
+// @filename: file2.ts
+///
+export { };
diff --git a/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es2015.2.minified.js b/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es2015.2.minified.js
index 2234b9cae16d..98fdd3114198 100644
--- a/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es2015.2.minified.js
@@ -1 +1,2 @@
export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es5.1.normal.js b/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es5.1.normal.js
index 6adbcf1f414c..b440e0fb34e0 100644
--- a/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es5.1.normal.js
@@ -5,3 +5,6 @@
// @filename: file1.ts
///
export { };
+// @filename: file2.ts
+///
+export { };
diff --git a/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es5.2.minified.js b/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es5.2.minified.js
index 2234b9cae16d..98fdd3114198 100644
--- a/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/libReferenceDeclarationEmit_es5.2.minified.js
@@ -1 +1,2 @@
export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/libReferenceNoLibBundle_es2015.1.normal.js b/crates/swc/tests/tsc-references/libReferenceNoLibBundle_es2015.1.normal.js
index 664e2bbb285f..04330c8505e5 100644
--- a/crates/swc/tests/tsc-references/libReferenceNoLibBundle_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/libReferenceNoLibBundle_es2015.1.normal.js
@@ -5,6 +5,8 @@
// @outFile: bundle.js
// Test that passing noLib disables resolution.
// @filename: fakelib.ts
+// @filename: file1.ts
+///
export const elem = {
field: 'a'
};
diff --git a/crates/swc/tests/tsc-references/libReferenceNoLibBundle_es5.1.normal.js b/crates/swc/tests/tsc-references/libReferenceNoLibBundle_es5.1.normal.js
index 421248fb3bca..2e4debf5d29e 100644
--- a/crates/swc/tests/tsc-references/libReferenceNoLibBundle_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/libReferenceNoLibBundle_es5.1.normal.js
@@ -5,6 +5,8 @@
// @outFile: bundle.js
// Test that passing noLib disables resolution.
// @filename: fakelib.ts
+// @filename: file1.ts
+///
export var elem = {
field: "a"
};
diff --git a/crates/swc/tests/tsc-references/libReferenceNoLib_es2015.1.normal.js b/crates/swc/tests/tsc-references/libReferenceNoLib_es2015.1.normal.js
index e4002dbcdbdc..6c23ca5d1ad7 100644
--- a/crates/swc/tests/tsc-references/libReferenceNoLib_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/libReferenceNoLib_es2015.1.normal.js
@@ -4,6 +4,8 @@
// @declaration: true
// Test that passing noLib disables resolution.
// @filename: fakelib.ts
+// @filename: file1.ts
+///
export const elem = {
field: 'a'
};
diff --git a/crates/swc/tests/tsc-references/libReferenceNoLib_es5.1.normal.js b/crates/swc/tests/tsc-references/libReferenceNoLib_es5.1.normal.js
index 3839be3d52b8..be76a43e5372 100644
--- a/crates/swc/tests/tsc-references/libReferenceNoLib_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/libReferenceNoLib_es5.1.normal.js
@@ -4,6 +4,8 @@
// @declaration: true
// Test that passing noLib disables resolution.
// @filename: fakelib.ts
+// @filename: file1.ts
+///
export var elem = {
field: "a"
};
diff --git a/crates/swc/tests/tsc-references/library-reference-15_es2015.1.normal.js b/crates/swc/tests/tsc-references/library-reference-15_es2015.1.normal.js
index 48cdb34b1996..2334699bf95e 100644
--- a/crates/swc/tests/tsc-references/library-reference-15_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/library-reference-15_es2015.1.normal.js
@@ -4,6 +4,7 @@
// @currentDirectory: /a
// @typeRoots: types
// @filename: /a/types/jquery/index.d.ts
+// @filename: /a/types/jquery2/index.d.ts
// @filename: /a/b/consumer.ts
$.foo(); // should OK
$2.foo(); // should error
diff --git a/crates/swc/tests/tsc-references/library-reference-15_es5.1.normal.js b/crates/swc/tests/tsc-references/library-reference-15_es5.1.normal.js
index 48cdb34b1996..2334699bf95e 100644
--- a/crates/swc/tests/tsc-references/library-reference-15_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/library-reference-15_es5.1.normal.js
@@ -4,6 +4,7 @@
// @currentDirectory: /a
// @typeRoots: types
// @filename: /a/types/jquery/index.d.ts
+// @filename: /a/types/jquery2/index.d.ts
// @filename: /a/b/consumer.ts
$.foo(); // should OK
$2.foo(); // should error
diff --git a/crates/swc/tests/tsc-references/library-reference-4_es2015.1.normal.js b/crates/swc/tests/tsc-references/library-reference-4_es2015.1.normal.js
index 8ae40418cba2..cc64b5647570 100644
--- a/crates/swc/tests/tsc-references/library-reference-4_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/library-reference-4_es2015.1.normal.js
@@ -5,6 +5,10 @@
// Secondary references may be duplicated if they agree in content
// @filename: /node_modules/foo/index.d.ts
///
- // @filename: /src/root.ts
- ///
- ///
+// @filename: /node_modules/foo/node_modules/alpha/index.d.ts
+// @filename: /node_modules/bar/index.d.ts
+///
+// @filename: /node_modules/bar/node_modules/alpha/index.d.ts
+// @filename: /src/root.ts
+///
+///
diff --git a/crates/swc/tests/tsc-references/library-reference-4_es5.1.normal.js b/crates/swc/tests/tsc-references/library-reference-4_es5.1.normal.js
index 8ae40418cba2..cc64b5647570 100644
--- a/crates/swc/tests/tsc-references/library-reference-4_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/library-reference-4_es5.1.normal.js
@@ -5,6 +5,10 @@
// Secondary references may be duplicated if they agree in content
// @filename: /node_modules/foo/index.d.ts
///
- // @filename: /src/root.ts
- ///
- ///
+// @filename: /node_modules/foo/node_modules/alpha/index.d.ts
+// @filename: /node_modules/bar/index.d.ts
+///
+// @filename: /node_modules/bar/node_modules/alpha/index.d.ts
+// @filename: /src/root.ts
+///
+///
diff --git a/crates/swc/tests/tsc-references/library-reference-5_es2015.1.normal.js b/crates/swc/tests/tsc-references/library-reference-5_es2015.1.normal.js
index 08313b321d6b..7c0ada462568 100644
--- a/crates/swc/tests/tsc-references/library-reference-5_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/library-reference-5_es2015.1.normal.js
@@ -5,6 +5,10 @@
// Secondary references may not be duplicated if they disagree in content
// @filename: /node_modules/foo/index.d.ts
///
- // @filename: /src/root.ts
- ///
- ///
+// @filename: /node_modules/foo/node_modules/alpha/index.d.ts
+// @filename: /node_modules/bar/index.d.ts
+///
+// @filename: /node_modules/bar/node_modules/alpha/index.d.ts
+// @filename: /src/root.ts
+///
+///
diff --git a/crates/swc/tests/tsc-references/library-reference-5_es5.1.normal.js b/crates/swc/tests/tsc-references/library-reference-5_es5.1.normal.js
index 08313b321d6b..7c0ada462568 100644
--- a/crates/swc/tests/tsc-references/library-reference-5_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/library-reference-5_es5.1.normal.js
@@ -5,6 +5,10 @@
// Secondary references may not be duplicated if they disagree in content
// @filename: /node_modules/foo/index.d.ts
///
- // @filename: /src/root.ts
- ///
- ///
+// @filename: /node_modules/foo/node_modules/alpha/index.d.ts
+// @filename: /node_modules/bar/index.d.ts
+///
+// @filename: /node_modules/bar/node_modules/alpha/index.d.ts
+// @filename: /src/root.ts
+///
+///
diff --git a/crates/swc/tests/tsc-references/library-reference-8_es2015.1.normal.js b/crates/swc/tests/tsc-references/library-reference-8_es2015.1.normal.js
index 82f10ed5c12e..1069a32daccd 100644
--- a/crates/swc/tests/tsc-references/library-reference-8_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/library-reference-8_es2015.1.normal.js
@@ -5,6 +5,8 @@
// Don't crash in circular library reference situations
// @filename: /test/types/alpha/index.d.ts
///
+// @filename: /test/types/beta/index.d.ts
+///
// @filename: /test/foo.ts
///
///
diff --git a/crates/swc/tests/tsc-references/library-reference-8_es5.1.normal.js b/crates/swc/tests/tsc-references/library-reference-8_es5.1.normal.js
index 82f10ed5c12e..1069a32daccd 100644
--- a/crates/swc/tests/tsc-references/library-reference-8_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/library-reference-8_es5.1.normal.js
@@ -5,6 +5,8 @@
// Don't crash in circular library reference situations
// @filename: /test/types/alpha/index.d.ts
///
+// @filename: /test/types/beta/index.d.ts
+///
// @filename: /test/foo.ts
///
///
diff --git a/crates/swc/tests/tsc-references/library-reference-scoped-packages_es2015.1.normal.js b/crates/swc/tests/tsc-references/library-reference-scoped-packages_es2015.1.normal.js
index e12a650116e2..3d49fe336dc1 100644
--- a/crates/swc/tests/tsc-references/library-reference-scoped-packages_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/library-reference-scoped-packages_es2015.1.normal.js
@@ -2,5 +2,6 @@
// @traceResolution: true
// @typeRoots: types
// @filename: /node_modules/@types/beep__boop/index.d.ts
-export const y = 0; // @filename: /a.ts
- ///
+export const y = 0;
+// @filename: /a.ts
+///
diff --git a/crates/swc/tests/tsc-references/library-reference-scoped-packages_es5.1.normal.js b/crates/swc/tests/tsc-references/library-reference-scoped-packages_es5.1.normal.js
index ae66f1ac55c0..2cb578fcb4e8 100644
--- a/crates/swc/tests/tsc-references/library-reference-scoped-packages_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/library-reference-scoped-packages_es5.1.normal.js
@@ -2,5 +2,6 @@
// @traceResolution: true
// @typeRoots: types
// @filename: /node_modules/@types/beep__boop/index.d.ts
-export var y = 0; // @filename: /a.ts
- ///
+export var y = 0;
+// @filename: /a.ts
+///
diff --git a/crates/swc/tests/tsc-references/mergedClassInterface_es2015.1.normal.js b/crates/swc/tests/tsc-references/mergedClassInterface_es2015.1.normal.js
index 4ff486aeb222..9ca0c875769c 100644
--- a/crates/swc/tests/tsc-references/mergedClassInterface_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/mergedClassInterface_es2015.1.normal.js
@@ -10,3 +10,5 @@ c5.x1;
c5.x2;
c5.x3;
c5.x4;
+// @Filename: file2.ts
+// @Filename: file3.ts
diff --git a/crates/swc/tests/tsc-references/mergedClassInterface_es5.1.normal.js b/crates/swc/tests/tsc-references/mergedClassInterface_es5.1.normal.js
index 7857a749b60b..478d7be3348e 100644
--- a/crates/swc/tests/tsc-references/mergedClassInterface_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/mergedClassInterface_es5.1.normal.js
@@ -15,3 +15,5 @@ c5.x1;
c5.x2;
c5.x3;
c5.x4;
+// @Filename: file2.ts
+// @Filename: file3.ts
diff --git a/crates/swc/tests/tsc-references/moduleExportAlias2_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAlias2_es2015.2.minified.js
index 889bd5115b5a..3f34f741904c 100644
--- a/crates/swc/tests/tsc-references/moduleExportAlias2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleExportAlias2_es2015.2.minified.js
@@ -1,6 +1,5 @@
-function C() {
+(exports = module.exports = function() {
this.p = 1;
-}
-(exports = module.exports = C).f = (n)=>n + 1;
+}).f = (n)=>n + 1;
const C = require("./semver");
C.f(1), new C;
diff --git a/crates/swc/tests/tsc-references/moduleExportAlias2_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAlias2_es5.2.minified.js
index 5ffddd937ecd..1143daee87c7 100644
--- a/crates/swc/tests/tsc-references/moduleExportAlias2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleExportAlias2_es5.2.minified.js
@@ -1,7 +1,6 @@
-function C() {
+(exports = module.exports = function() {
this.p = 1;
-}
-(exports = module.exports = C).f = function(n) {
+}).f = function(n) {
return n + 1;
};
var C = require("./semver");
diff --git a/crates/swc/tests/tsc-references/moduleExportAliasImported_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAliasImported_es2015.2.minified.js
index 1af71eca3623..d66d5e40dd5d 100644
--- a/crates/swc/tests/tsc-references/moduleExportAliasImported_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleExportAliasImported_es2015.2.minified.js
@@ -1 +1,2 @@
-exports.version = 1, module.exports = function() {}, import('./bug28014');
+exports.version = 1, module.exports = function() {};
+import('./bug28014');
diff --git a/crates/swc/tests/tsc-references/moduleExportAliasImported_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAliasImported_es5.2.minified.js
index a55e7012189b..2cb3183d0a48 100644
--- a/crates/swc/tests/tsc-references/moduleExportAliasImported_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleExportAliasImported_es5.2.minified.js
@@ -1 +1,2 @@
-exports.version = 1, module.exports = function() {}, import("./bug28014");
+exports.version = 1, module.exports = function() {};
+import("./bug28014");
diff --git a/crates/swc/tests/tsc-references/moduleExportAlias_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAlias_es2015.1.normal.js
index 3bbb36705d46..82c9e75e1f10 100644
--- a/crates/swc/tests/tsc-references/moduleExportAlias_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/moduleExportAlias_es2015.1.normal.js
@@ -22,6 +22,7 @@ b.func17;
b.func18;
b.func19;
b.func20;
+export { };
// @filename: b.js
var exportsAlias = exports;
exportsAlias.func1 = function() {};
@@ -60,4 +61,3 @@ module.exports.func18 = function() {};
module.exports = {};
exports.func19 = function() {};
module.exports.func20 = function() {};
-export { };
diff --git a/crates/swc/tests/tsc-references/moduleExportAlias_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAlias_es2015.2.minified.js
index fbc09ac6cf85..dde5beb3141e 100644
--- a/crates/swc/tests/tsc-references/moduleExportAlias_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleExportAlias_es2015.2.minified.js
@@ -1,3 +1,4 @@
let b = require("./b.js");
-b.func1, b.func2, b.func3, b.func4, b.func5, b.func6, b.func7, b.func8, b.func9, b.func10, b.func11, b.func12, b.func13, b.func14, b.func15, b.func16, b.func17, b.func18, b.func19, b.func20, exports.func1 = function() {}, exports.func2 = function() {}, module.exports.func3 = function() {}, module.exports.func4 = function() {}, (exports = module.exports).func5 = function() {}, (module.exports = exports).func6 = function() {}, exports.func7 = function() {}, module.exports.func8 = function() {}, (module.exports = exports = {}).func9 = function() {}, (exports = module.exports = {}).func10 = function() {}, (exports = module.exports = {}).func11 = function() {}, module.exports.func12 = function() {}, (exports = module.exports = {}).func11 = function() {}, module.exports.func12 = function() {}, (exports = module.exports = {}).func13 = function() {}, module.exports.func14 = function() {}, (exports = module.exports = {}).func15 = function() {}, module.exports.func16 = function() {}, module.exports = exports = {}, exports.func17 = function() {}, module.exports.func18 = function() {}, module.exports = {}, exports.func19 = function() {}, module.exports.func20 = function() {};
+b.func1, b.func2, b.func3, b.func4, b.func5, b.func6, b.func7, b.func8, b.func9, b.func10, b.func11, b.func12, b.func13, b.func14, b.func15, b.func16, b.func17, b.func18, b.func19, b.func20;
export { };
+exports.func1 = function() {}, exports.func2 = function() {}, module.exports.func3 = function() {}, module.exports.func4 = function() {}, (exports = module.exports).func5 = function() {}, (module.exports = exports).func6 = function() {}, exports.func7 = function() {}, module.exports.func8 = function() {}, (module.exports = exports = {}).func9 = function() {}, (exports = module.exports = {}).func10 = function() {}, (exports = module.exports = {}).func11 = function() {}, module.exports.func12 = function() {}, (exports = module.exports = {}).func11 = function() {}, module.exports.func12 = function() {}, (exports = module.exports = {}).func13 = function() {}, module.exports.func14 = function() {}, (exports = module.exports = {}).func15 = function() {}, module.exports.func16 = function() {}, module.exports = exports = {}, exports.func17 = function() {}, module.exports.func18 = function() {}, module.exports = {}, exports.func19 = function() {}, module.exports.func20 = function() {};
diff --git a/crates/swc/tests/tsc-references/moduleExportAlias_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAlias_es5.1.normal.js
index 848dbd467fce..e97dd28e02dd 100644
--- a/crates/swc/tests/tsc-references/moduleExportAlias_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/moduleExportAlias_es5.1.normal.js
@@ -22,6 +22,7 @@ b.func17;
b.func18;
b.func19;
b.func20;
+export { };
// @filename: b.js
var exportsAlias = exports;
exportsAlias.func1 = function() {};
@@ -60,4 +61,3 @@ module.exports.func18 = function() {};
module.exports = {};
exports.func19 = function() {};
module.exports.func20 = function() {};
-export { };
diff --git a/crates/swc/tests/tsc-references/moduleExportAlias_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAlias_es5.2.minified.js
index 254e938cbcf9..5eeaf9682130 100644
--- a/crates/swc/tests/tsc-references/moduleExportAlias_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleExportAlias_es5.2.minified.js
@@ -1,3 +1,4 @@
var b = require("./b.js");
-b.func1, b.func2, b.func3, b.func4, b.func5, b.func6, b.func7, b.func8, b.func9, b.func10, b.func11, b.func12, b.func13, b.func14, b.func15, b.func16, b.func17, b.func18, b.func19, b.func20, exports.func1 = function() {}, exports.func2 = function() {}, module.exports.func3 = function() {}, module.exports.func4 = function() {}, (exports = module.exports).func5 = function() {}, (module.exports = exports).func6 = function() {}, exports.func7 = function() {}, module.exports.func8 = function() {}, (module.exports = exports = {}).func9 = function() {}, (exports = module.exports = {}).func10 = function() {}, (exports = module.exports = {}).func11 = function() {}, module.exports.func12 = function() {}, (exports = module.exports = {}).func11 = function() {}, module.exports.func12 = function() {}, (exports = module.exports = {}).func13 = function() {}, module.exports.func14 = function() {}, (exports = module.exports = {}).func15 = function() {}, module.exports.func16 = function() {}, module.exports = exports = {}, exports.func17 = function() {}, module.exports.func18 = function() {}, module.exports = {}, exports.func19 = function() {}, module.exports.func20 = function() {};
+b.func1, b.func2, b.func3, b.func4, b.func5, b.func6, b.func7, b.func8, b.func9, b.func10, b.func11, b.func12, b.func13, b.func14, b.func15, b.func16, b.func17, b.func18, b.func19, b.func20;
export { };
+exports.func1 = function() {}, exports.func2 = function() {}, module.exports.func3 = function() {}, module.exports.func4 = function() {}, (exports = module.exports).func5 = function() {}, (module.exports = exports).func6 = function() {}, exports.func7 = function() {}, module.exports.func8 = function() {}, (module.exports = exports = {}).func9 = function() {}, (exports = module.exports = {}).func10 = function() {}, (exports = module.exports = {}).func11 = function() {}, module.exports.func12 = function() {}, (exports = module.exports = {}).func11 = function() {}, module.exports.func12 = function() {}, (exports = module.exports = {}).func13 = function() {}, module.exports.func14 = function() {}, (exports = module.exports = {}).func15 = function() {}, module.exports.func16 = function() {}, module.exports = exports = {}, exports.func17 = function() {}, module.exports.func18 = function() {}, module.exports = {}, exports.func19 = function() {}, module.exports.func20 = function() {};
diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment3_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAssignment3_es2015.2.minified.js
index 687a13c229f9..02aa69fb0490 100644
--- a/crates/swc/tests/tsc-references/moduleExportAssignment3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleExportAssignment3_es2015.2.minified.js
@@ -1 +1,2 @@
-module.exports = function() {}, module.exports(), require('./mod')();
+module.exports = function() {}, module.exports();
+require('./mod')();
diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment3_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAssignment3_es5.2.minified.js
index 96662cdee420..d59bcc6c7b67 100644
--- a/crates/swc/tests/tsc-references/moduleExportAssignment3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleExportAssignment3_es5.2.minified.js
@@ -1 +1,2 @@
-module.exports = function() {}, module.exports(), require("./mod")();
+module.exports = function() {}, module.exports();
+require("./mod")();
diff --git a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias2_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias2_es5.2.minified.js
index bbff9a2a2410..7441ec47a46a 100644
--- a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias2_es5.2.minified.js
@@ -1,2 +1,3 @@
function a() {}
-module.exports.apply = void 0, module.exports.apply = a, module.exports.apply = a, module.exports.apply(), (0, require("./moduleExportAliasDuplicateAlias").apply)();
+module.exports.apply = void 0, module.exports.apply = a, module.exports.apply = a, module.exports.apply();
+(0, require("./moduleExportAliasDuplicateAlias").apply)();
diff --git a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias3_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias3_es5.2.minified.js
index def8c2050491..4f26d6fe73ba 100644
--- a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias3_es5.2.minified.js
@@ -1 +1,2 @@
-exports.apply = void 0, exports.apply = void 0, exports.apply = function() {}, exports.apply(), exports.apply = "ok", exports.apply.toUpperCase(), exports.apply = 1, require("./moduleExportAliasDuplicateAlias").apply.toFixed();
+exports.apply = void 0, exports.apply = void 0, exports.apply = function() {}, exports.apply(), exports.apply = "ok", exports.apply.toUpperCase(), exports.apply = 1;
+require("./moduleExportAliasDuplicateAlias").apply.toFixed();
diff --git a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es5.2.minified.js
index c4ea00dce213..739eacf6d37b 100644
--- a/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleExportDuplicateAlias_es5.2.minified.js
@@ -1 +1,2 @@
-exports.apply = void 0, exports.apply(), exports.apply = function() {}, exports.apply(), (0, require("./moduleExportAliasDuplicateAlias").apply)();
+exports.apply = void 0, exports.apply(), exports.apply = function() {}, exports.apply();
+(0, require("./moduleExportAliasDuplicateAlias").apply)();
diff --git a/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment2_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment2_es2015.2.minified.js
new file mode 100644
index 000000000000..acb77b0d868d
--- /dev/null
+++ b/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment2_es2015.2.minified.js
@@ -0,0 +1 @@
+GlobalThing.x;
diff --git a/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment2_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment2_es5.2.minified.js
new file mode 100644
index 000000000000..acb77b0d868d
--- /dev/null
+++ b/crates/swc/tests/tsc-references/moduleExportsElementAccessAssignment2_es5.2.minified.js
@@ -0,0 +1 @@
+GlobalThing.x;
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es2015.1.normal.js
index 2b938970e375..5b486d582e00 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es2015.1.normal.js
@@ -1,4 +1,13 @@
// @traceResolution: true
// @Filename: /src/a.ts
-export default 0;
-export default x;
+export default 0; // No extension: '.ts' added
+// @Filename: /src/b.ts
+export { }; // '.js' extension: stripped and replaced with '.ts'
+// @Filename: /src/d.ts
+export { };
+// @Filename: /src/jquery.d.ts
+export default x; // No extension: '.d.ts' added
+// @Filename: /src/jquery_user_1.ts
+export { }; // '.js' extension: stripped and replaced with '.d.ts'
+// @Filename: /src/jquery_user_1.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es2015.2.minified.js
index 34f8fa27f50d..a809f9a03f58 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es2015.2.minified.js
@@ -1,2 +1,6 @@
export default 0;
+export { };
+export { };
export default x;
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es5.1.normal.js
index 2b938970e375..5b486d582e00 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es5.1.normal.js
@@ -1,4 +1,13 @@
// @traceResolution: true
// @Filename: /src/a.ts
-export default 0;
-export default x;
+export default 0; // No extension: '.ts' added
+// @Filename: /src/b.ts
+export { }; // '.js' extension: stripped and replaced with '.ts'
+// @Filename: /src/d.ts
+export { };
+// @Filename: /src/jquery.d.ts
+export default x; // No extension: '.d.ts' added
+// @Filename: /src/jquery_user_1.ts
+export { }; // '.js' extension: stripped and replaced with '.d.ts'
+// @Filename: /src/jquery_user_1.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es5.2.minified.js
index 34f8fa27f50d..a809f9a03f58 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithExtensions_es5.2.minified.js
@@ -1,2 +1,6 @@
export default 0;
+export { };
+export { };
export default x;
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es2015.1.normal.js
index eb162ed3bd68..e00db44c4e13 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es2015.1.normal.js
@@ -4,4 +4,6 @@
export function foo() {
return "";
}
- // should error, ask for extension, no extension suggestion
+// @filename: /src/bar.mts
+// Extensionless relative path ES import in an ES module
+export { }; // should error, ask for extension, no extension suggestion
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es2015.2.minified.js
index 0d096c0f72fe..cf1e0c923c55 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es2015.2.minified.js
@@ -1,3 +1,4 @@
export function foo() {
return "";
}
+export { };
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es5.1.normal.js
index eb162ed3bd68..e00db44c4e13 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es5.1.normal.js
@@ -4,4 +4,6 @@
export function foo() {
return "";
}
- // should error, ask for extension, no extension suggestion
+// @filename: /src/bar.mts
+// Extensionless relative path ES import in an ES module
+export { }; // should error, ask for extension, no extension suggestion
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es5.2.minified.js
index 0d096c0f72fe..cf1e0c923c55 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension1_es5.2.minified.js
@@ -1,3 +1,4 @@
export function foo() {
return "";
}
+export { };
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es2015.1.normal.js
index d92acd6006b1..4a4cfa69bfde 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es2015.1.normal.js
@@ -5,4 +5,6 @@
export function foo() {
return "";
}
- // should error, suggest adding ".jsx"
+// @filename: /src/bar.mts
+// Extensionless relative path ES import in an ES module
+export { }; // should error, suggest adding ".jsx"
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es2015.2.minified.js
index 0d096c0f72fe..cf1e0c923c55 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es2015.2.minified.js
@@ -1,3 +1,4 @@
export function foo() {
return "";
}
+export { };
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es5.1.normal.js
index d92acd6006b1..4a4cfa69bfde 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es5.1.normal.js
@@ -5,4 +5,6 @@
export function foo() {
return "";
}
- // should error, suggest adding ".jsx"
+// @filename: /src/bar.mts
+// Extensionless relative path ES import in an ES module
+export { }; // should error, suggest adding ".jsx"
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es5.2.minified.js
index 0d096c0f72fe..cf1e0c923c55 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension3_es5.2.minified.js
@@ -1,3 +1,4 @@
export function foo() {
return "";
}
+export { };
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es2015.1.normal.js
index 404a4d72ec03..e096de7d970d 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es2015.1.normal.js
@@ -5,4 +5,6 @@
export function foo() {
return "";
}
- // should error, suggest adding ".js"
+// @filename: /src/bar.mts
+// Extensionless relative path ES import in an ES module
+export { }; // should error, suggest adding ".js"
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es2015.2.minified.js
index 0d096c0f72fe..cf1e0c923c55 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es2015.2.minified.js
@@ -1,3 +1,4 @@
export function foo() {
return "";
}
+export { };
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es5.1.normal.js
index 404a4d72ec03..e096de7d970d 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es5.1.normal.js
@@ -5,4 +5,6 @@
export function foo() {
return "";
}
- // should error, suggest adding ".js"
+// @filename: /src/bar.mts
+// Extensionless relative path ES import in an ES module
+export { }; // should error, suggest adding ".js"
diff --git a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es5.2.minified.js
index 0d096c0f72fe..cf1e0c923c55 100644
--- a/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleResolutionWithoutExtension4_es5.2.minified.js
@@ -1,3 +1,4 @@
export function foo() {
return "";
}
+export { };
diff --git a/crates/swc/tests/tsc-references/moduleScoping_es2015.1.normal.js b/crates/swc/tests/tsc-references/moduleScoping_es2015.1.normal.js
index aae5d679621a..383271ff35f0 100644
--- a/crates/swc/tests/tsc-references/moduleScoping_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/moduleScoping_es2015.1.normal.js
@@ -19,5 +19,6 @@ var v4 = {
a: true,
b: NaN
}; // Should shadow global v2 in this module
+export { };
// @Filename: file5.ts
var x = v2; // Should be global v2 of type number again
diff --git a/crates/swc/tests/tsc-references/moduleScoping_es2015.2.minified.js b/crates/swc/tests/tsc-references/moduleScoping_es2015.2.minified.js
index 85e9581f49ef..8ffdb778a24a 100644
--- a/crates/swc/tests/tsc-references/moduleScoping_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleScoping_es2015.2.minified.js
@@ -1,3 +1,5 @@
export var v3 = !0;
let file3 = require('./file3');
-file3.v3;
+v1, v2, file3.v3;
+export { };
+v2;
diff --git a/crates/swc/tests/tsc-references/moduleScoping_es5.1.normal.js b/crates/swc/tests/tsc-references/moduleScoping_es5.1.normal.js
index f1868e82b2f0..c565d099fb17 100644
--- a/crates/swc/tests/tsc-references/moduleScoping_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/moduleScoping_es5.1.normal.js
@@ -21,5 +21,6 @@ var v4 = {
a: true,
b: NaN
}; // Should shadow global v2 in this module
+export { };
// @Filename: file5.ts
var x = v2; // Should be global v2 of type number again
diff --git a/crates/swc/tests/tsc-references/moduleScoping_es5.2.minified.js b/crates/swc/tests/tsc-references/moduleScoping_es5.2.minified.js
index ef63cfcd403c..bff9a677da18 100644
--- a/crates/swc/tests/tsc-references/moduleScoping_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/moduleScoping_es5.2.minified.js
@@ -1,2 +1,4 @@
export var v3 = !0;
-require("./file3").v3;
+v1, v2, require("./file3").v3;
+export { };
+v2;
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.1.normal.js
index 79bfe444197b..814552f1f22f 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.1.normal.js
@@ -1,11 +1,38 @@
// @module: commonjs
// @target: ES5
// @filename: m1.ts
-export default class foo {
-};
-export default function bar() {};
-var x = 10;
-export default x;
+//!
+//! x the name `default` is exported multiple times
+//! ,-[2:1]
+//! 2 | ,-> export default class foo {
+//! 3 | |
+//! 4 | |-> }
+//! : `---- previous exported here
+//! 5 |
+//! 6 | ,-> export default function bar() {
+//! 7 | |
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
+//!
+//! x the name `default` is exported multiple times
+//! ,-[6:1]
+//! 6 | ,-> export default function bar() {
+//! 7 | |
+//! 8 | |-> }
+//! : `---- previous exported here
+//! 9 |
+//! 10 | var x = 10;
+//! 11 | ,-> export default x;
+//! : | ^^^^^^^^|^^^^^^^^
+//! : | `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
// @filename: m2.ts
import Entity from "./m1";
Entity();
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.2.minified.js
index b11a12f9ca41..e3189a8bfa23 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports01_es2015.2.minified.js
@@ -1,6 +1,35 @@
-export default class foo {
-};
-export default function bar() {};
-export default 10;
+// @filename: m1.ts
+//!
+//! x the name `default` is exported multiple times
+//! ,-[2:1]
+//! 2 | ,-> export default class foo {
+//! 3 | |
+//! 4 | |-> }
+//! : `---- previous exported here
+//! 5 |
+//! 6 | ,-> export default function bar() {
+//! 7 | |
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
+//!
+//! x the name `default` is exported multiple times
+//! ,-[6:1]
+//! 6 | ,-> export default function bar() {
+//! 7 | |
+//! 8 | |-> }
+//! : `---- previous exported here
+//! 9 |
+//! 10 | var x = 10;
+//! 11 | ,-> export default x;
+//! : | ^^^^^^^^|^^^^^^^^
+//! : | `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
import Entity from "./m1";
Entity();
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.1.normal.js
index 76cb2f7f6ef2..814552f1f22f 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.1.normal.js
@@ -1,15 +1,38 @@
// @module: commonjs
// @target: ES5
// @filename: m1.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var foo = function foo() {
- "use strict";
- _class_call_check(this, foo);
-};
-export { foo as default };
-export default function bar() {};
-var x = 10;
-export default x;
+//!
+//! x the name `default` is exported multiple times
+//! ,-[2:1]
+//! 2 | ,-> export default class foo {
+//! 3 | |
+//! 4 | |-> }
+//! : `---- previous exported here
+//! 5 |
+//! 6 | ,-> export default function bar() {
+//! 7 | |
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
+//!
+//! x the name `default` is exported multiple times
+//! ,-[6:1]
+//! 6 | ,-> export default function bar() {
+//! 7 | |
+//! 8 | |-> }
+//! : `---- previous exported here
+//! 9 |
+//! 10 | var x = 10;
+//! 11 | ,-> export default x;
+//! : | ^^^^^^^^|^^^^^^^^
+//! : | `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
// @filename: m2.ts
import Entity from "./m1";
Entity();
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.2.minified.js
index 13c4af51414d..e3189a8bfa23 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports01_es5.2.minified.js
@@ -1,10 +1,35 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var foo = function() {
- "use strict";
- _class_call_check(this, foo);
-};
-export default function bar() {};
-export default 10;
+// @filename: m1.ts
+//!
+//! x the name `default` is exported multiple times
+//! ,-[2:1]
+//! 2 | ,-> export default class foo {
+//! 3 | |
+//! 4 | |-> }
+//! : `---- previous exported here
+//! 5 |
+//! 6 | ,-> export default function bar() {
+//! 7 | |
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
+//!
+//! x the name `default` is exported multiple times
+//! ,-[6:1]
+//! 6 | ,-> export default function bar() {
+//! 7 | |
+//! 8 | |-> }
+//! : `---- previous exported here
+//! 9 |
+//! 10 | var x = 10;
+//! 11 | ,-> export default x;
+//! : | ^^^^^^^^|^^^^^^^^
+//! : | `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
import Entity from "./m1";
Entity();
-export { foo as default };
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.1.normal.js
index e8f6a39a701f..20f57c98e1c2 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.1.normal.js
@@ -1,8 +1,22 @@
// @module: commonjs
// @target: ES5
// @filename: m1.ts
-export default function foo() {};
-export default function bar() {};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[2:1]
+//! 2 | ,-> export default function foo() {
+//! 3 | |
+//! 4 | |-> }
+//! : `---- previous exported here
+//! 5 |
+//! 6 | ,-> export default function bar() {
+//! 7 | |
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
// @filename: m2.ts
import Entity from "./m1";
Entity();
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.2.minified.js
index a08c26e33585..3cf84d5e088e 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports02_es2015.2.minified.js
@@ -1,4 +1,19 @@
-export default function foo() {};
-export default function bar() {};
+// @filename: m1.ts
+//!
+//! x the name `default` is exported multiple times
+//! ,-[2:1]
+//! 2 | ,-> export default function foo() {
+//! 3 | |
+//! 4 | |-> }
+//! : `---- previous exported here
+//! 5 |
+//! 6 | ,-> export default function bar() {
+//! 7 | |
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
import Entity from "./m1";
Entity();
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.1.normal.js
index e8f6a39a701f..20f57c98e1c2 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.1.normal.js
@@ -1,8 +1,22 @@
// @module: commonjs
// @target: ES5
// @filename: m1.ts
-export default function foo() {};
-export default function bar() {};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[2:1]
+//! 2 | ,-> export default function foo() {
+//! 3 | |
+//! 4 | |-> }
+//! : `---- previous exported here
+//! 5 |
+//! 6 | ,-> export default function bar() {
+//! 7 | |
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
// @filename: m2.ts
import Entity from "./m1";
Entity();
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.2.minified.js
index a08c26e33585..3cf84d5e088e 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports02_es5.2.minified.js
@@ -1,4 +1,19 @@
-export default function foo() {};
-export default function bar() {};
+// @filename: m1.ts
+//!
+//! x the name `default` is exported multiple times
+//! ,-[2:1]
+//! 2 | ,-> export default function foo() {
+//! 3 | |
+//! 4 | |-> }
+//! : `---- previous exported here
+//! 5 |
+//! 6 | ,-> export default function bar() {
+//! 7 | |
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
import Entity from "./m1";
Entity();
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports03_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports03_es2015.1.normal.js
index 618c485e6dff..05dea9f32f62 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports03_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports03_es2015.1.normal.js
@@ -1,6 +1,14 @@
-// @module: commonjs
-// @target: ES5
-export default class C {
-};
-export default class C {
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[4:1]
+//! 4 | ,-> export default class C {
+//! 5 | |-> }
+//! : `---- previous exported here
+//! 6 |
+//! 7 | ,-> export default class C {
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports03_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports03_es2015.2.minified.js
index 9ebc72efc8f3..05dea9f32f62 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports03_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports03_es2015.2.minified.js
@@ -1,4 +1,14 @@
-export default class C {
-};
-export default class C {
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[4:1]
+//! 4 | ,-> export default class C {
+//! 5 | |-> }
+//! : `---- previous exported here
+//! 6 |
+//! 7 | ,-> export default class C {
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports03_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports03_es5.1.normal.js
index 88da4eab97c7..05dea9f32f62 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports03_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports03_es5.1.normal.js
@@ -1,13 +1,14 @@
-// @module: commonjs
-// @target: ES5
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var C = function C() {
- "use strict";
- _class_call_check(this, C);
-};
-export { C as default };
-var C = function C() {
- "use strict";
- _class_call_check(this, C);
-};
-export { C as default };
+//!
+//! x the name `default` is exported multiple times
+//! ,-[4:1]
+//! 4 | ,-> export default class C {
+//! 5 | |-> }
+//! : `---- previous exported here
+//! 6 |
+//! 7 | ,-> export default class C {
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports03_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports03_es5.2.minified.js
index 0d191c5f339f..05dea9f32f62 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports03_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports03_es5.2.minified.js
@@ -1,10 +1,14 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var C = function() {
- "use strict";
- _class_call_check(this, C);
-};
-var C = function() {
- "use strict";
- _class_call_check(this, C);
-};
-export { C as default, C as default };
+//!
+//! x the name `default` is exported multiple times
+//! ,-[4:1]
+//! 4 | ,-> export default class C {
+//! 5 | |-> }
+//! : `---- previous exported here
+//! 6 |
+//! 7 | ,-> export default class C {
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.1.normal.js
index 1f0c7f71846b..e7e6800ede68 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.1.normal.js
@@ -1,4 +1,26 @@
-// @module: commonjs
-// @target: ES5
-export default function f() {};
-export default function f() {};
+//!
+//! x the name `f` is defined multiple times
+//! ,-[4:1]
+//! 4 | export default function f() {
+//! : |
+//! : `-- previous definition of `f` here
+//! 5 | }
+//! 6 |
+//! 7 | export default function f() {
+//! : |
+//! : `-- `f` redefined here
+//! `----
+//!
+//! x the name `default` is exported multiple times
+//! ,-[4:1]
+//! 4 | ,-> export default function f() {
+//! 5 | |-> }
+//! : `---- previous exported here
+//! 6 |
+//! 7 | ,-> export default function f() {
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.2.minified.js
index 9ec4772c02ae..e7e6800ede68 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports04_es2015.2.minified.js
@@ -1,2 +1,26 @@
-export default function f() {};
-export default function f() {};
+//!
+//! x the name `f` is defined multiple times
+//! ,-[4:1]
+//! 4 | export default function f() {
+//! : |
+//! : `-- previous definition of `f` here
+//! 5 | }
+//! 6 |
+//! 7 | export default function f() {
+//! : |
+//! : `-- `f` redefined here
+//! `----
+//!
+//! x the name `default` is exported multiple times
+//! ,-[4:1]
+//! 4 | ,-> export default function f() {
+//! 5 | |-> }
+//! : `---- previous exported here
+//! 6 |
+//! 7 | ,-> export default function f() {
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.1.normal.js
index 1f0c7f71846b..e7e6800ede68 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.1.normal.js
@@ -1,4 +1,26 @@
-// @module: commonjs
-// @target: ES5
-export default function f() {};
-export default function f() {};
+//!
+//! x the name `f` is defined multiple times
+//! ,-[4:1]
+//! 4 | export default function f() {
+//! : |
+//! : `-- previous definition of `f` here
+//! 5 | }
+//! 6 |
+//! 7 | export default function f() {
+//! : |
+//! : `-- `f` redefined here
+//! `----
+//!
+//! x the name `default` is exported multiple times
+//! ,-[4:1]
+//! 4 | ,-> export default function f() {
+//! 5 | |-> }
+//! : `---- previous exported here
+//! 6 |
+//! 7 | ,-> export default function f() {
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.2.minified.js
index 9ec4772c02ae..e7e6800ede68 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports04_es5.2.minified.js
@@ -1,2 +1,26 @@
-export default function f() {};
-export default function f() {};
+//!
+//! x the name `f` is defined multiple times
+//! ,-[4:1]
+//! 4 | export default function f() {
+//! : |
+//! : `-- previous definition of `f` here
+//! 5 | }
+//! 6 |
+//! 7 | export default function f() {
+//! : |
+//! : `-- `f` redefined here
+//! `----
+//!
+//! x the name `default` is exported multiple times
+//! ,-[4:1]
+//! 4 | ,-> export default function f() {
+//! 5 | |-> }
+//! : `---- previous exported here
+//! 6 |
+//! 7 | ,-> export default function f() {
+//! 8 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports05_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports05_es2015.1.normal.js
index 3202eba2fb79..c8d2de205883 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports05_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports05_es2015.1.normal.js
@@ -1,8 +1,28 @@
-// @module: commonjs
-// @target: ES5
-export default class AA1 {
-};
-export default class BB1 {
-};
-export default class CC1 {
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[4:1]
+//! 4 | export default class AA1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- previous exported here
+//! 5 |
+//! 6 | export default class BB1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
+//!
+//! x the name `default` is exported multiple times
+//! ,-[6:1]
+//! 6 | export default class BB1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- previous exported here
+//! 7 |
+//! 8 | export default class CC1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports05_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports05_es2015.2.minified.js
index 47840ba12789..c8d2de205883 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports05_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports05_es2015.2.minified.js
@@ -1,6 +1,28 @@
-export default class AA1 {
-};
-export default class BB1 {
-};
-export default class CC1 {
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[4:1]
+//! 4 | export default class AA1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- previous exported here
+//! 5 |
+//! 6 | export default class BB1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
+//!
+//! x the name `default` is exported multiple times
+//! ,-[6:1]
+//! 6 | export default class BB1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- previous exported here
+//! 7 |
+//! 8 | export default class CC1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports05_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleDefaultExports05_es5.1.normal.js
index 0a77f5be0aad..c8d2de205883 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports05_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports05_es5.1.normal.js
@@ -1,18 +1,28 @@
-// @module: commonjs
-// @target: ES5
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var AA1 = function AA1() {
- "use strict";
- _class_call_check(this, AA1);
-};
-export { AA1 as default };
-var BB1 = function BB1() {
- "use strict";
- _class_call_check(this, BB1);
-};
-export { BB1 as default };
-var CC1 = function CC1() {
- "use strict";
- _class_call_check(this, CC1);
-};
-export { CC1 as default };
+//!
+//! x the name `default` is exported multiple times
+//! ,-[4:1]
+//! 4 | export default class AA1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- previous exported here
+//! 5 |
+//! 6 | export default class BB1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
+//!
+//! x the name `default` is exported multiple times
+//! ,-[6:1]
+//! 6 | export default class BB1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- previous exported here
+//! 7 |
+//! 8 | export default class CC1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleDefaultExports05_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleDefaultExports05_es5.2.minified.js
index 1bed29a41a9d..c8d2de205883 100644
--- a/crates/swc/tests/tsc-references/multipleDefaultExports05_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleDefaultExports05_es5.2.minified.js
@@ -1,14 +1,28 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var AA1 = function() {
- "use strict";
- _class_call_check(this, AA1);
-};
-var BB1 = function() {
- "use strict";
- _class_call_check(this, BB1);
-};
-var CC1 = function() {
- "use strict";
- _class_call_check(this, CC1);
-};
-export { AA1 as default, BB1 as default, CC1 as default };
+//!
+//! x the name `default` is exported multiple times
+//! ,-[4:1]
+//! 4 | export default class AA1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- previous exported here
+//! 5 |
+//! 6 | export default class BB1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
+//!
+//! x the name `default` is exported multiple times
+//! ,-[6:1]
+//! 6 | export default class BB1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- previous exported here
+//! 7 |
+//! 8 | export default class CC1 {}
+//! : ^^^^^^^^^^^^^|^^^^^^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.1.normal.js
index ed59f54944ca..7de6cb6ae661 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.1.normal.js
@@ -1,4 +1,16 @@
-export default function Foo() {};
-export default {
- uhoh: "another default"
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default function Foo (){
+//! 2 | |
+//! 3 | |-> }
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default {
+//! 6 | | uhoh: "another default",
+//! 7 | |-> };
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.2.minified.js
index ed59f54944ca..7de6cb6ae661 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault1_es2015.2.minified.js
@@ -1,4 +1,16 @@
-export default function Foo() {};
-export default {
- uhoh: "another default"
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default function Foo (){
+//! 2 | |
+//! 3 | |-> }
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default {
+//! 6 | | uhoh: "another default",
+//! 7 | |-> };
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault1_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault1_es5.1.normal.js
index ed59f54944ca..7de6cb6ae661 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault1_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault1_es5.1.normal.js
@@ -1,4 +1,16 @@
-export default function Foo() {};
-export default {
- uhoh: "another default"
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default function Foo (){
+//! 2 | |
+//! 3 | |-> }
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default {
+//! 6 | | uhoh: "another default",
+//! 7 | |-> };
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault1_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault1_es5.2.minified.js
index ed59f54944ca..7de6cb6ae661 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault1_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault1_es5.2.minified.js
@@ -1,4 +1,16 @@
-export default function Foo() {};
-export default {
- uhoh: "another default"
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default function Foo (){
+//! 2 | |
+//! 3 | |-> }
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default {
+//! 6 | | uhoh: "another default",
+//! 7 | |-> };
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.1.normal.js
index 4233c2c30b12..df0da87a5ee4 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.1.normal.js
@@ -1,4 +1,15 @@
-export default {
- uhoh: "another default"
-};
-export default function Foo() {};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default {
+//! 2 | | uhoh: "another default",
+//! 3 | |-> };
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default function Foo() { }
+//! : | ^^^^^^^^^^^^^^^^|^^^^^^^^^^^^^^^^
+//! : | `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.2.minified.js
index 4233c2c30b12..df0da87a5ee4 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault2_es2015.2.minified.js
@@ -1,4 +1,15 @@
-export default {
- uhoh: "another default"
-};
-export default function Foo() {};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default {
+//! 2 | | uhoh: "another default",
+//! 3 | |-> };
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default function Foo() { }
+//! : | ^^^^^^^^^^^^^^^^|^^^^^^^^^^^^^^^^
+//! : | `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault2_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault2_es5.1.normal.js
index 4233c2c30b12..df0da87a5ee4 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault2_es5.1.normal.js
@@ -1,4 +1,15 @@
-export default {
- uhoh: "another default"
-};
-export default function Foo() {};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default {
+//! 2 | | uhoh: "another default",
+//! 3 | |-> };
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default function Foo() { }
+//! : | ^^^^^^^^^^^^^^^^|^^^^^^^^^^^^^^^^
+//! : | `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault2_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault2_es5.2.minified.js
index 4233c2c30b12..df0da87a5ee4 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault2_es5.2.minified.js
@@ -1,4 +1,15 @@
-export default {
- uhoh: "another default"
-};
-export default function Foo() {};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default {
+//! 2 | | uhoh: "another default",
+//! 3 | |-> };
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default function Foo() { }
+//! : | ^^^^^^^^^^^^^^^^|^^^^^^^^^^^^^^^^
+//! : | `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault3_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault3_es2015.1.normal.js
index e854b44be4ea..fac35712318f 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault3_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault3_es2015.1.normal.js
@@ -1,5 +1,15 @@
-export default {
- uhoh: "another default"
-};
-export default class C {
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default {
+//! 2 | | uhoh: "another default",
+//! 3 | |-> };
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default class C { }
+//! : | ^^^^^^^^^^^^^|^^^^^^^^^^^^
+//! : | `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault3_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault3_es2015.2.minified.js
index e854b44be4ea..fac35712318f 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault3_es2015.2.minified.js
@@ -1,5 +1,15 @@
-export default {
- uhoh: "another default"
-};
-export default class C {
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default {
+//! 2 | | uhoh: "another default",
+//! 3 | |-> };
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default class C { }
+//! : | ^^^^^^^^^^^^^|^^^^^^^^^^^^
+//! : | `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault3_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault3_es5.1.normal.js
index 12c21e7adb3c..fac35712318f 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault3_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault3_es5.1.normal.js
@@ -1,9 +1,15 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-export default {
- uhoh: "another default"
-};
-var C = function C() {
- "use strict";
- _class_call_check(this, C);
-};
-export { C as default };
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default {
+//! 2 | | uhoh: "another default",
+//! 3 | |-> };
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default class C { }
+//! : | ^^^^^^^^^^^^^|^^^^^^^^^^^^
+//! : | `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault3_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault3_es5.2.minified.js
index a7bf7315b2f9..fac35712318f 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault3_es5.2.minified.js
@@ -1,9 +1,15 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-export default {
- uhoh: "another default"
-};
-var C = function() {
- "use strict";
- _class_call_check(this, C);
-};
-export { C as default };
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default {
+//! 2 | | uhoh: "another default",
+//! 3 | |-> };
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default class C { }
+//! : | ^^^^^^^^^^^^^|^^^^^^^^^^^^
+//! : | `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault4_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault4_es2015.1.normal.js
index 1f0c8731ca31..96807eb6a628 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault4_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault4_es2015.1.normal.js
@@ -1,5 +1,15 @@
-export default class C {
-};
-export default {
- uhoh: "another default"
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default class C { }
+//! : | ^^^^^^^^^^^^^|^^^^^^^^^^^^
+//! : | `-- previous exported here
+//! 2 |
+//! 3 | ,-> export default {
+//! 4 | | uhoh: "another default",
+//! 5 | |-> };
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault4_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault4_es2015.2.minified.js
index 1f0c8731ca31..96807eb6a628 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault4_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault4_es2015.2.minified.js
@@ -1,5 +1,15 @@
-export default class C {
-};
-export default {
- uhoh: "another default"
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default class C { }
+//! : | ^^^^^^^^^^^^^|^^^^^^^^^^^^
+//! : | `-- previous exported here
+//! 2 |
+//! 3 | ,-> export default {
+//! 4 | | uhoh: "another default",
+//! 5 | |-> };
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault4_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault4_es5.1.normal.js
index 9d055b83670b..96807eb6a628 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault4_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault4_es5.1.normal.js
@@ -1,9 +1,15 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var C = function C() {
- "use strict";
- _class_call_check(this, C);
-};
-export { C as default };
-export default {
- uhoh: "another default"
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default class C { }
+//! : | ^^^^^^^^^^^^^|^^^^^^^^^^^^
+//! : | `-- previous exported here
+//! 2 |
+//! 3 | ,-> export default {
+//! 4 | | uhoh: "another default",
+//! 5 | |-> };
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault4_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault4_es5.2.minified.js
index adf041c02d8f..96807eb6a628 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault4_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault4_es5.2.minified.js
@@ -1,9 +1,15 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var C = function() {
- "use strict";
- _class_call_check(this, C);
-};
-export default {
- uhoh: "another default"
-};
-export { C as default };
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default class C { }
+//! : | ^^^^^^^^^^^^^|^^^^^^^^^^^^
+//! : | `-- previous exported here
+//! 2 |
+//! 3 | ,-> export default {
+//! 4 | | uhoh: "another default",
+//! 5 | |-> };
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.1.normal.js
index 0e7967e58ca3..ff36bfdb86d8 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.1.normal.js
@@ -1,3 +1,13 @@
-export default function bar() {};
-export default class C {
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | export default function bar() { }
+//! : ^^^^^^^^^^^^^^^^|^^^^^^^^^^^^^^^^
+//! : `-- previous exported here
+//! 2 | export default class C {}
+//! : ^^^^^^^^^^^^|^^^^^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.2.minified.js
index 0e7967e58ca3..ff36bfdb86d8 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault5_es2015.2.minified.js
@@ -1,3 +1,13 @@
-export default function bar() {};
-export default class C {
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | export default function bar() { }
+//! : ^^^^^^^^^^^^^^^^|^^^^^^^^^^^^^^^^
+//! : `-- previous exported here
+//! 2 | export default class C {}
+//! : ^^^^^^^^^^^^|^^^^^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault5_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault5_es5.1.normal.js
index dac80b434125..ff36bfdb86d8 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault5_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault5_es5.1.normal.js
@@ -1,7 +1,13 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-export default function bar() {};
-var C = function C() {
- "use strict";
- _class_call_check(this, C);
-};
-export { C as default };
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | export default function bar() { }
+//! : ^^^^^^^^^^^^^^^^|^^^^^^^^^^^^^^^^
+//! : `-- previous exported here
+//! 2 | export default class C {}
+//! : ^^^^^^^^^^^^|^^^^^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault5_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault5_es5.2.minified.js
index 9e6af4072766..ff36bfdb86d8 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault5_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault5_es5.2.minified.js
@@ -1,7 +1,13 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-export default function bar() {};
-var C = function() {
- "use strict";
- _class_call_check(this, C);
-};
-export { C as default };
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | export default function bar() { }
+//! : ^^^^^^^^^^^^^^^^|^^^^^^^^^^^^^^^^
+//! : `-- previous exported here
+//! 2 | export default class C {}
+//! : ^^^^^^^^^^^^|^^^^^^^^^^^^
+//! : `-- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault6_es2015.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault6_es2015.1.normal.js
index 6c3f7191059d..85d28bffb6ff 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault6_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault6_es2015.1.normal.js
@@ -1,6 +1,16 @@
-export default {
- lol: 1
-};
-export default {
- lol: 2
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default {
+//! 2 | | lol: 1
+//! 3 | |-> }
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default {
+//! 6 | | lol: 2
+//! 7 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault6_es2015.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault6_es2015.2.minified.js
index 6c3f7191059d..85d28bffb6ff 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault6_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault6_es2015.2.minified.js
@@ -1,6 +1,16 @@
-export default {
- lol: 1
-};
-export default {
- lol: 2
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default {
+//! 2 | | lol: 1
+//! 3 | |-> }
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default {
+//! 6 | | lol: 2
+//! 7 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault6_es5.1.normal.js b/crates/swc/tests/tsc-references/multipleExportDefault6_es5.1.normal.js
index 6c3f7191059d..85d28bffb6ff 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault6_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault6_es5.1.normal.js
@@ -1,6 +1,16 @@
-export default {
- lol: 1
-};
-export default {
- lol: 2
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default {
+//! 2 | | lol: 1
+//! 3 | |-> }
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default {
+//! 6 | | lol: 2
+//! 7 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/multipleExportDefault6_es5.2.minified.js b/crates/swc/tests/tsc-references/multipleExportDefault6_es5.2.minified.js
index 6c3f7191059d..85d28bffb6ff 100644
--- a/crates/swc/tests/tsc-references/multipleExportDefault6_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/multipleExportDefault6_es5.2.minified.js
@@ -1,6 +1,16 @@
-export default {
- lol: 1
-};
-export default {
- lol: 2
-};
+//!
+//! x the name `default` is exported multiple times
+//! ,-[1:1]
+//! 1 | ,-> export default {
+//! 2 | | lol: 1
+//! 3 | |-> }
+//! : `---- previous exported here
+//! 4 |
+//! 5 | ,-> export default {
+//! 6 | | lol: 2
+//! 7 | |-> }
+//! : `---- exported more than once
+//! `----
+//!
+//!Error:
+//! > Exported identifiers must be unique
diff --git a/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es2015.1.normal.js b/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es2015.1.normal.js
index c5f4f223ca3c..c22094c5bb17 100644
--- a/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es2015.1.normal.js
@@ -4,3 +4,4 @@ export var foo = 42;
// @Filename: foo_1.ts
const foo = require('./test/foo_0');
var x = foo.foo + 42;
+export { };
diff --git a/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es2015.2.minified.js b/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es2015.2.minified.js
index a81adc6bceb2..dab83210df09 100644
--- a/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es2015.2.minified.js
@@ -1,3 +1,4 @@
export var foo = 42;
let foo = require('./test/foo_0');
foo.foo;
+export { };
diff --git a/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es5.1.normal.js b/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es5.1.normal.js
index 45cf41c95d93..ba2c016cd150 100644
--- a/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es5.1.normal.js
@@ -4,3 +4,4 @@ export var foo = 42;
// @Filename: foo_1.ts
var foo = require("./test/foo_0");
var x = foo.foo + 42;
+export { };
diff --git a/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es5.2.minified.js b/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es5.2.minified.js
index 8d2ae86f83bf..7fa208f47abc 100644
--- a/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/nameDelimitedBySlashes_es5.2.minified.js
@@ -1,3 +1,3 @@
export var foo = 42;
-var foo = require("./test/foo_0");
-foo.foo;
+require("./test/foo_0").foo;
+export { };
diff --git a/crates/swc/tests/tsc-references/nameWithFileExtension_es2015.1.normal.js b/crates/swc/tests/tsc-references/nameWithFileExtension_es2015.1.normal.js
index 2f3ee283b731..1ffc0495a05a 100644
--- a/crates/swc/tests/tsc-references/nameWithFileExtension_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/nameWithFileExtension_es2015.1.normal.js
@@ -4,3 +4,4 @@ export var foo = 42;
// @Filename: foo_1.ts
const foo = require('./foo_0.js');
var x = foo.foo + 42;
+export { };
diff --git a/crates/swc/tests/tsc-references/nameWithFileExtension_es2015.2.minified.js b/crates/swc/tests/tsc-references/nameWithFileExtension_es2015.2.minified.js
index 5ec3acf63389..116965fe1818 100644
--- a/crates/swc/tests/tsc-references/nameWithFileExtension_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/nameWithFileExtension_es2015.2.minified.js
@@ -1,3 +1,4 @@
export var foo = 42;
let foo = require('./foo_0.js');
foo.foo;
+export { };
diff --git a/crates/swc/tests/tsc-references/nameWithFileExtension_es5.1.normal.js b/crates/swc/tests/tsc-references/nameWithFileExtension_es5.1.normal.js
index 02fa7b5aec60..008594162d69 100644
--- a/crates/swc/tests/tsc-references/nameWithFileExtension_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/nameWithFileExtension_es5.1.normal.js
@@ -4,3 +4,4 @@ export var foo = 42;
// @Filename: foo_1.ts
var foo = require("./foo_0.js");
var x = foo.foo + 42;
+export { };
diff --git a/crates/swc/tests/tsc-references/nameWithFileExtension_es5.2.minified.js b/crates/swc/tests/tsc-references/nameWithFileExtension_es5.2.minified.js
index 21c0b55b46b2..17ce25d74b3e 100644
--- a/crates/swc/tests/tsc-references/nameWithFileExtension_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/nameWithFileExtension_es5.2.minified.js
@@ -1,3 +1,3 @@
export var foo = 42;
-var foo = require("./foo_0.js");
-foo.foo;
+require("./foo_0.js").foo;
+export { };
diff --git a/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.1.normal.js b/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.1.normal.js
index ea7e54d6cdb8..60a98d3f2803 100644
--- a/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.1.normal.js
@@ -17,3 +17,4 @@ const foo2 = require('./.././test/foo_2');
if (foo2.M2.x) {
var x = foo0.foo + foo1.f();
}
+export { };
diff --git a/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.2.minified.js b/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.2.minified.js
index afe431539b8f..0051f9645a8b 100644
--- a/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/nameWithRelativePaths_es2015.2.minified.js
@@ -6,3 +6,4 @@ export var M2;
(M2 || (M2 = {})).x = !0;
let foo0 = require('../foo_0'), foo1 = require('./test/foo_1'), foo2 = require('./.././test/foo_2');
foo2.M2.x && (foo0.foo, foo1.f());
+export { };
diff --git a/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.1.normal.js b/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.1.normal.js
index 1f30ae621377..8f7b0b49899b 100644
--- a/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.1.normal.js
@@ -17,3 +17,4 @@ var foo2 = require("./.././test/foo_2");
if (foo2.M2.x) {
var x = foo0.foo + foo1.f();
}
+export { };
diff --git a/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.2.minified.js b/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.2.minified.js
index e0fe688e9fe5..33827bd4fc94 100644
--- a/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/nameWithRelativePaths_es5.2.minified.js
@@ -6,3 +6,4 @@ export var M2;
(M2 || (M2 = {})).x = !0;
var foo0 = require("../foo_0"), foo1 = require("./test/foo_1"), foo2 = require("./.././test/foo_2");
foo2.M2.x && (foo0.foo, foo1.f());
+export { };
diff --git a/crates/swc/tests/tsc-references/namedTupleMembersErrors_es2015.1.normal.js b/crates/swc/tests/tsc-references/namedTupleMembersErrors_es2015.1.normal.js
new file mode 100644
index 000000000000..245cf251a430
--- /dev/null
+++ b/crates/swc/tests/tsc-references/namedTupleMembersErrors_es2015.1.normal.js
@@ -0,0 +1,17 @@
+//!
+//! x Only named exports may use 'export type'.
+//! ,----
+//! 16 | export type OptTrailing = [first: string, rest: ...string[]?]; // dots+question on element disallowed
+//! : ^^^^^^^^^^^
+//! `----
+//!
+//! x Expected '{', got 'OptTrailing'
+//! ,----
+//! 16 | export type OptTrailing = [first: string, rest: ...string[]?]; // dots+question on element disallowed
+//! : ^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/namedTupleMembersErrors_es2015.2.minified.js b/crates/swc/tests/tsc-references/namedTupleMembersErrors_es2015.2.minified.js
new file mode 100644
index 000000000000..245cf251a430
--- /dev/null
+++ b/crates/swc/tests/tsc-references/namedTupleMembersErrors_es2015.2.minified.js
@@ -0,0 +1,17 @@
+//!
+//! x Only named exports may use 'export type'.
+//! ,----
+//! 16 | export type OptTrailing = [first: string, rest: ...string[]?]; // dots+question on element disallowed
+//! : ^^^^^^^^^^^
+//! `----
+//!
+//! x Expected '{', got 'OptTrailing'
+//! ,----
+//! 16 | export type OptTrailing = [first: string, rest: ...string[]?]; // dots+question on element disallowed
+//! : ^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/namedTupleMembersErrors_es5.1.normal.js b/crates/swc/tests/tsc-references/namedTupleMembersErrors_es5.1.normal.js
new file mode 100644
index 000000000000..245cf251a430
--- /dev/null
+++ b/crates/swc/tests/tsc-references/namedTupleMembersErrors_es5.1.normal.js
@@ -0,0 +1,17 @@
+//!
+//! x Only named exports may use 'export type'.
+//! ,----
+//! 16 | export type OptTrailing = [first: string, rest: ...string[]?]; // dots+question on element disallowed
+//! : ^^^^^^^^^^^
+//! `----
+//!
+//! x Expected '{', got 'OptTrailing'
+//! ,----
+//! 16 | export type OptTrailing = [first: string, rest: ...string[]?]; // dots+question on element disallowed
+//! : ^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/namedTupleMembersErrors_es5.2.minified.js b/crates/swc/tests/tsc-references/namedTupleMembersErrors_es5.2.minified.js
new file mode 100644
index 000000000000..245cf251a430
--- /dev/null
+++ b/crates/swc/tests/tsc-references/namedTupleMembersErrors_es5.2.minified.js
@@ -0,0 +1,17 @@
+//!
+//! x Only named exports may use 'export type'.
+//! ,----
+//! 16 | export type OptTrailing = [first: string, rest: ...string[]?]; // dots+question on element disallowed
+//! : ^^^^^^^^^^^
+//! `----
+//!
+//! x Expected '{', got 'OptTrailing'
+//! ,----
+//! 16 | export type OptTrailing = [first: string, rest: ...string[]?]; // dots+question on element disallowed
+//! : ^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es2015.1.normal.js b/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es2015.1.normal.js
index 188f17388241..a4e71dede5fe 100644
--- a/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es2015.1.normal.js
@@ -3,5 +3,7 @@ class A {
}
export class B {
}
+// @Filename: /b.ts
let A;
let B;
+export { };
diff --git a/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es2015.2.minified.js b/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es2015.2.minified.js
index 94fa3c9c47a3..7706e5964d47 100644
--- a/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es2015.2.minified.js
@@ -1,2 +1,3 @@
export class B {
}
+export { };
diff --git a/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es5.1.normal.js b/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es5.1.normal.js
index 1395be8a02f7..50b5998965ba 100644
--- a/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es5.1.normal.js
@@ -8,5 +8,7 @@ export var B = function B() {
"use strict";
_class_call_check(this, B);
};
+// @Filename: /b.ts
var A;
var B;
+export { };
diff --git a/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es5.2.minified.js b/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es5.2.minified.js
index 4b246476ca02..99cbffe59865 100644
--- a/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/namespaceImportTypeQuery_es5.2.minified.js
@@ -1,5 +1,5 @@
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var A, B, A = function() {
+var A = function() {
"use strict";
_class_call_check(this, A);
};
@@ -7,3 +7,4 @@ export var B = function() {
"use strict";
_class_call_check(this, B);
};
+export { };
diff --git a/crates/swc/tests/tsc-references/namespaceMemberAccess_es2015.1.normal.js b/crates/swc/tests/tsc-references/namespaceMemberAccess_es2015.1.normal.js
index 20c8c83d554c..3520f15f002e 100644
--- a/crates/swc/tests/tsc-references/namespaceMemberAccess_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/namespaceMemberAccess_es2015.1.normal.js
@@ -1,6 +1,7 @@
// @Filename: /a.ts
class A {
}
+export { };
// @Filename: /b.ts
import * as types from './a';
types.A;
diff --git a/crates/swc/tests/tsc-references/namespaceMemberAccess_es2015.2.minified.js b/crates/swc/tests/tsc-references/namespaceMemberAccess_es2015.2.minified.js
index 6174230a39f9..fd8aa71ddb41 100644
--- a/crates/swc/tests/tsc-references/namespaceMemberAccess_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/namespaceMemberAccess_es2015.2.minified.js
@@ -1,3 +1,4 @@
+export { };
import * as types from './a';
types.A;
let { A } = types;
diff --git a/crates/swc/tests/tsc-references/namespaceMemberAccess_es5.1.normal.js b/crates/swc/tests/tsc-references/namespaceMemberAccess_es5.1.normal.js
index ba6e4c429163..3bb1fedbd642 100644
--- a/crates/swc/tests/tsc-references/namespaceMemberAccess_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/namespaceMemberAccess_es5.1.normal.js
@@ -4,6 +4,7 @@ var A = function A() {
"use strict";
_class_call_check(this, A);
};
+export { };
// @Filename: /b.ts
import * as types from "./a";
types.A;
diff --git a/crates/swc/tests/tsc-references/namespaceMemberAccess_es5.2.minified.js b/crates/swc/tests/tsc-references/namespaceMemberAccess_es5.2.minified.js
index 3995b1bb5869..7cd5574ffc73 100644
--- a/crates/swc/tests/tsc-references/namespaceMemberAccess_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/namespaceMemberAccess_es5.2.minified.js
@@ -4,5 +4,4 @@ var A = function() {
_class_call_check(this, A);
};
import * as types from "./a";
-types.A;
-var A = types.A;
+types.A, types.A;
diff --git a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es2015.2.minified.js b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es2015.2.minified.js
index 951566ef22c1..3a2c95e66365 100644
--- a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es2015.2.minified.js
@@ -2,3 +2,4 @@ module.exports.chalk = {
grey: {}
};
const { chalk: { grey } } = require('./mod1');
+chalk;
diff --git a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es5.2.minified.js b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es5.2.minified.js
index 5292e4905a0b..16f8e972a7c5 100644
--- a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire_es5.2.minified.js
@@ -1,3 +1,4 @@
module.exports.chalk = {
grey: {}
-}, require("./mod1").chalk.grey;
+};
+require("./mod1").chalk.grey, chalk;
diff --git a/crates/swc/tests/tsc-references/nestedNamespace_es2015.1.normal.js b/crates/swc/tests/tsc-references/nestedNamespace_es2015.1.normal.js
index e38b1e563218..b2999a72c851 100644
--- a/crates/swc/tests/tsc-references/nestedNamespace_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/nestedNamespace_es2015.1.normal.js
@@ -5,3 +5,5 @@ export var types;
}
types.A = A;
})(types || (types = {}));
+// @Filename: b.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/nestedNamespace_es2015.2.minified.js b/crates/swc/tests/tsc-references/nestedNamespace_es2015.2.minified.js
index f62073269b35..c0940f942dda 100644
--- a/crates/swc/tests/tsc-references/nestedNamespace_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/nestedNamespace_es2015.2.minified.js
@@ -1,3 +1,4 @@
export var types;
(types || (types = {})).A = class {
};
+export { };
diff --git a/crates/swc/tests/tsc-references/nestedNamespace_es5.1.normal.js b/crates/swc/tests/tsc-references/nestedNamespace_es5.1.normal.js
index 7877cdcd1d97..84e17ac2479c 100644
--- a/crates/swc/tests/tsc-references/nestedNamespace_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/nestedNamespace_es5.1.normal.js
@@ -8,3 +8,5 @@ export var types;
};
types.A = A;
})(types || (types = {}));
+// @Filename: b.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/nestedNamespace_es5.2.minified.js b/crates/swc/tests/tsc-references/nestedNamespace_es5.2.minified.js
index 7b431b1d7e40..c7a3ae8c8f77 100644
--- a/crates/swc/tests/tsc-references/nestedNamespace_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/nestedNamespace_es5.2.minified.js
@@ -7,3 +7,4 @@ export var types;
};
types.A = A;
}(types || (types = {}));
+export { };
diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator5_es2015.1.normal.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator5_es2015.1.normal.js
new file mode 100644
index 000000000000..8e48fba31b47
--- /dev/null
+++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator5_es2015.1.normal.js
@@ -0,0 +1,30 @@
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 8 | a ?? b || c;
+//! : ^^^^^^^^^^^
+//! `----
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 11 | a || b ?? c;
+//! : ^^^^^^
+//! `----
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 14 | a ?? b && c;
+//! : ^^^^^^
+//! `----
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 17 | a && b ?? c;
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator5_es2015.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator5_es2015.2.minified.js
new file mode 100644
index 000000000000..8e48fba31b47
--- /dev/null
+++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator5_es2015.2.minified.js
@@ -0,0 +1,30 @@
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 8 | a ?? b || c;
+//! : ^^^^^^^^^^^
+//! `----
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 11 | a || b ?? c;
+//! : ^^^^^^
+//! `----
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 14 | a ?? b && c;
+//! : ^^^^^^
+//! `----
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 17 | a && b ?? c;
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator5_es5.1.normal.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator5_es5.1.normal.js
new file mode 100644
index 000000000000..8e48fba31b47
--- /dev/null
+++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator5_es5.1.normal.js
@@ -0,0 +1,30 @@
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 8 | a ?? b || c;
+//! : ^^^^^^^^^^^
+//! `----
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 11 | a || b ?? c;
+//! : ^^^^^^
+//! `----
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 14 | a ?? b && c;
+//! : ^^^^^^
+//! `----
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 17 | a && b ?? c;
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator5_es5.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator5_es5.2.minified.js
new file mode 100644
index 000000000000..8e48fba31b47
--- /dev/null
+++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator5_es5.2.minified.js
@@ -0,0 +1,30 @@
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 8 | a ?? b || c;
+//! : ^^^^^^^^^^^
+//! `----
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 11 | a || b ?? c;
+//! : ^^^^^^
+//! `----
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 14 | a ?? b && c;
+//! : ^^^^^^
+//! `----
+//!
+//! x Nullish coalescing operator(??) requires parens when mixing with logical operators
+//! ,----
+//! 17 | a && b ?? c;
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/objectTypesWithPredefinedTypesAsName_es2015.1.normal.js b/crates/swc/tests/tsc-references/objectTypesWithPredefinedTypesAsName_es2015.1.normal.js
new file mode 100644
index 000000000000..84167276ed2f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/objectTypesWithPredefinedTypesAsName_es2015.1.normal.js
@@ -0,0 +1,30 @@
+//!
+//! x Invalid class name
+//! ,----
+//! 3 | class any { }
+//! : ^^^
+//! `----
+//!
+//! x Invalid class name
+//! ,----
+//! 5 | class number { }
+//! : ^^^^^^
+//! `----
+//!
+//! x Invalid class name
+//! ,----
+//! 7 | class boolean { }
+//! : ^^^^^^^
+//! `----
+//!
+//! x Invalid class name
+//! ,----
+//! 10 | class string { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/objectTypesWithPredefinedTypesAsName_es2015.2.minified.js b/crates/swc/tests/tsc-references/objectTypesWithPredefinedTypesAsName_es2015.2.minified.js
new file mode 100644
index 000000000000..84167276ed2f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/objectTypesWithPredefinedTypesAsName_es2015.2.minified.js
@@ -0,0 +1,30 @@
+//!
+//! x Invalid class name
+//! ,----
+//! 3 | class any { }
+//! : ^^^
+//! `----
+//!
+//! x Invalid class name
+//! ,----
+//! 5 | class number { }
+//! : ^^^^^^
+//! `----
+//!
+//! x Invalid class name
+//! ,----
+//! 7 | class boolean { }
+//! : ^^^^^^^
+//! `----
+//!
+//! x Invalid class name
+//! ,----
+//! 10 | class string { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/objectTypesWithPredefinedTypesAsName_es5.1.normal.js b/crates/swc/tests/tsc-references/objectTypesWithPredefinedTypesAsName_es5.1.normal.js
new file mode 100644
index 000000000000..84167276ed2f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/objectTypesWithPredefinedTypesAsName_es5.1.normal.js
@@ -0,0 +1,30 @@
+//!
+//! x Invalid class name
+//! ,----
+//! 3 | class any { }
+//! : ^^^
+//! `----
+//!
+//! x Invalid class name
+//! ,----
+//! 5 | class number { }
+//! : ^^^^^^
+//! `----
+//!
+//! x Invalid class name
+//! ,----
+//! 7 | class boolean { }
+//! : ^^^^^^^
+//! `----
+//!
+//! x Invalid class name
+//! ,----
+//! 10 | class string { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/objectTypesWithPredefinedTypesAsName_es5.2.minified.js b/crates/swc/tests/tsc-references/objectTypesWithPredefinedTypesAsName_es5.2.minified.js
new file mode 100644
index 000000000000..84167276ed2f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/objectTypesWithPredefinedTypesAsName_es5.2.minified.js
@@ -0,0 +1,30 @@
+//!
+//! x Invalid class name
+//! ,----
+//! 3 | class any { }
+//! : ^^^
+//! `----
+//!
+//! x Invalid class name
+//! ,----
+//! 5 | class number { }
+//! : ^^^^^^
+//! `----
+//!
+//! x Invalid class name
+//! ,----
+//! 7 | class boolean { }
+//! : ^^^^^^^
+//! `----
+//!
+//! x Invalid class name
+//! ,----
+//! 10 | class string { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/outFilerootDirModuleNamesAmd_es5.2.minified.js b/crates/swc/tests/tsc-references/outFilerootDirModuleNamesAmd_es5.2.minified.js
index fc493f1384e1..4b82ddf37457 100644
--- a/crates/swc/tests/tsc-references/outFilerootDirModuleNamesAmd_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/outFilerootDirModuleNamesAmd_es5.2.minified.js
@@ -5,9 +5,9 @@ var Foo = function() {
_class_call_check(this, Foo);
};
foo();
+export { Foo as default };
import Foo from "./a";
export default function foo() {
new Foo();
};
import("./a");
-export { Foo as default };
diff --git a/crates/swc/tests/tsc-references/outFilerootDirModuleNamesSystem_es5.2.minified.js b/crates/swc/tests/tsc-references/outFilerootDirModuleNamesSystem_es5.2.minified.js
index fc493f1384e1..4b82ddf37457 100644
--- a/crates/swc/tests/tsc-references/outFilerootDirModuleNamesSystem_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/outFilerootDirModuleNamesSystem_es5.2.minified.js
@@ -5,9 +5,9 @@ var Foo = function() {
_class_call_check(this, Foo);
};
foo();
+export { Foo as default };
import Foo from "./a";
export default function foo() {
new Foo();
};
import("./a");
-export { Foo as default };
diff --git a/crates/swc/tests/tsc-references/override1_es2015.1.normal.js b/crates/swc/tests/tsc-references/override1_es2015.1.normal.js
new file mode 100644
index 000000000000..22676c85ca57
--- /dev/null
+++ b/crates/swc/tests/tsc-references/override1_es2015.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 17 | override foo(v: string) {}
+//! : ^^^^^^^^
+//! `----
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 44 | override foo () {}
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/override1_es2015.2.minified.js b/crates/swc/tests/tsc-references/override1_es2015.2.minified.js
new file mode 100644
index 000000000000..22676c85ca57
--- /dev/null
+++ b/crates/swc/tests/tsc-references/override1_es2015.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 17 | override foo(v: string) {}
+//! : ^^^^^^^^
+//! `----
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 44 | override foo () {}
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/override1_es5.1.normal.js b/crates/swc/tests/tsc-references/override1_es5.1.normal.js
new file mode 100644
index 000000000000..22676c85ca57
--- /dev/null
+++ b/crates/swc/tests/tsc-references/override1_es5.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 17 | override foo(v: string) {}
+//! : ^^^^^^^^
+//! `----
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 44 | override foo () {}
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/override1_es5.2.minified.js b/crates/swc/tests/tsc-references/override1_es5.2.minified.js
new file mode 100644
index 000000000000..22676c85ca57
--- /dev/null
+++ b/crates/swc/tests/tsc-references/override1_es5.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 17 | override foo(v: string) {}
+//! : ^^^^^^^^
+//! `----
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 44 | override foo () {}
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/overrideWithoutNoImplicitOverride1_es2015.1.normal.js b/crates/swc/tests/tsc-references/overrideWithoutNoImplicitOverride1_es2015.1.normal.js
new file mode 100644
index 000000000000..4e02f346a781
--- /dev/null
+++ b/crates/swc/tests/tsc-references/overrideWithoutNoImplicitOverride1_es2015.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 4 | override yadda(): void;
+//! : ^^^^^^^^
+//! `----
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 8 | override yadda(): void {}
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/overrideWithoutNoImplicitOverride1_es2015.2.minified.js b/crates/swc/tests/tsc-references/overrideWithoutNoImplicitOverride1_es2015.2.minified.js
new file mode 100644
index 000000000000..4e02f346a781
--- /dev/null
+++ b/crates/swc/tests/tsc-references/overrideWithoutNoImplicitOverride1_es2015.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 4 | override yadda(): void;
+//! : ^^^^^^^^
+//! `----
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 8 | override yadda(): void {}
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/overrideWithoutNoImplicitOverride1_es5.1.normal.js b/crates/swc/tests/tsc-references/overrideWithoutNoImplicitOverride1_es5.1.normal.js
new file mode 100644
index 000000000000..4e02f346a781
--- /dev/null
+++ b/crates/swc/tests/tsc-references/overrideWithoutNoImplicitOverride1_es5.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 4 | override yadda(): void;
+//! : ^^^^^^^^
+//! `----
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 8 | override yadda(): void {}
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/overrideWithoutNoImplicitOverride1_es5.2.minified.js b/crates/swc/tests/tsc-references/overrideWithoutNoImplicitOverride1_es5.2.minified.js
new file mode 100644
index 000000000000..4e02f346a781
--- /dev/null
+++ b/crates/swc/tests/tsc-references/overrideWithoutNoImplicitOverride1_es5.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 4 | override yadda(): void;
+//! : ^^^^^^^^
+//! `----
+//!
+//! x This member cannot have an 'override' modifier because its containing class does not extend another class.
+//! ,----
+//! 8 | override yadda(): void {}
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/paramTagTypeResolution_es2015.2.minified.js b/crates/swc/tests/tsc-references/paramTagTypeResolution_es2015.2.minified.js
index 47b0a12e29bc..b46ab39aff06 100644
--- a/crates/swc/tests/tsc-references/paramTagTypeResolution_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/paramTagTypeResolution_es2015.2.minified.js
@@ -1,3 +1,4 @@
module.exports = function(x, k) {
return k(x);
-}, require('./first')(1, (n)=>{});
+};
+require('./first')(1, (n)=>{});
diff --git a/crates/swc/tests/tsc-references/paramTagTypeResolution_es5.2.minified.js b/crates/swc/tests/tsc-references/paramTagTypeResolution_es5.2.minified.js
index c1053e3d4a60..f808b16dc731 100644
--- a/crates/swc/tests/tsc-references/paramTagTypeResolution_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/paramTagTypeResolution_es5.2.minified.js
@@ -1,3 +1,4 @@
module.exports = function(x, k) {
return k(x);
-}, require("./first")(1, function(n) {});
+};
+require("./first")(1, function(n) {});
diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression1_es2015.1.normal.js
new file mode 100644
index 000000000000..6ae734ac2cc0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression1_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 1 | var v = (public x: string) => { };
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression1_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression1_es2015.2.minified.js
new file mode 100644
index 000000000000..6ae734ac2cc0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression1_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 1 | var v = (public x: string) => { };
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression1_es5.1.normal.js
new file mode 100644
index 000000000000..6ae734ac2cc0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression1_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 1 | var v = (public x: string) => { };
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression1_es5.2.minified.js
new file mode 100644
index 000000000000..6ae734ac2cc0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression1_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 1 | var v = (public x: string) => { };
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserAssignmentExpression1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserAssignmentExpression1_es2015.1.normal.js
new file mode 100644
index 000000000000..34da6634ef04
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserAssignmentExpression1_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | (foo()) = bar;
+//! : ^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserAssignmentExpression1_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserAssignmentExpression1_es2015.2.minified.js
new file mode 100644
index 000000000000..34da6634ef04
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserAssignmentExpression1_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | (foo()) = bar;
+//! : ^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserAssignmentExpression1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserAssignmentExpression1_es5.1.normal.js
new file mode 100644
index 000000000000..34da6634ef04
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserAssignmentExpression1_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | (foo()) = bar;
+//! : ^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserAssignmentExpression1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserAssignmentExpression1_es5.2.minified.js
new file mode 100644
index 000000000000..34da6634ef04
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserAssignmentExpression1_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | (foo()) = bar;
+//! : ^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration24_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration24_es2015.1.normal.js
new file mode 100644
index 000000000000..9e6a7f9ecc9c
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserClassDeclaration24_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x Invalid class name
+//! ,----
+//! 1 | class any {
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration24_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration24_es2015.2.minified.js
new file mode 100644
index 000000000000..9e6a7f9ecc9c
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserClassDeclaration24_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x Invalid class name
+//! ,----
+//! 1 | class any {
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration24_es5.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration24_es5.1.normal.js
new file mode 100644
index 000000000000..9e6a7f9ecc9c
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserClassDeclaration24_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x Invalid class name
+//! ,----
+//! 1 | class any {
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration24_es5.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration24_es5.2.minified.js
new file mode 100644
index 000000000000..9e6a7f9ecc9c
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserClassDeclaration24_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x Invalid class name
+//! ,----
+//! 1 | class any {
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName37_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName37_es2015.1.normal.js
new file mode 100644
index 000000000000..42f73115cd3f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserComputedPropertyName37_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x Unexpected token `public`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp,
+//! | ` for template literal, (, or an identifier
+//! ,----
+//! 3 | [public]: 0
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName37_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName37_es2015.2.minified.js
new file mode 100644
index 000000000000..42f73115cd3f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserComputedPropertyName37_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x Unexpected token `public`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp,
+//! | ` for template literal, (, or an identifier
+//! ,----
+//! 3 | [public]: 0
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName37_es5.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName37_es5.1.normal.js
new file mode 100644
index 000000000000..42f73115cd3f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserComputedPropertyName37_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x Unexpected token `public`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp,
+//! | ` for template literal, (, or an identifier
+//! ,----
+//! 3 | [public]: 0
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName37_es5.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName37_es5.2.minified.js
new file mode 100644
index 000000000000..42f73115cd3f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserComputedPropertyName37_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x Unexpected token `public`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp,
+//! | ` for template literal, (, or an identifier
+//! ,----
+//! 3 | [public]: 0
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement5_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement5_es2015.1.normal.js
new file mode 100644
index 000000000000..aa3e38d44eb7
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement5_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 2 | for (var a: number of X) {
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement5_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement5_es2015.2.minified.js
new file mode 100644
index 000000000000..aa3e38d44eb7
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement5_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 2 | for (var a: number of X) {
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement5_es5.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement5_es5.1.normal.js
new file mode 100644
index 000000000000..aa3e38d44eb7
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement5_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 2 | for (var a: number of X) {
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement5_es5.2.minified.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement5_es5.2.minified.js
new file mode 100644
index 000000000000..aa3e38d44eb7
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserES5ForOfStatement5_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 2 | for (var a: number of X) {
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserEnum7_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserEnum7_es2015.1.normal.js
new file mode 100644
index 000000000000..8e790aafcbb3
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserEnum7_es2015.1.normal.js
@@ -0,0 +1,24 @@
+//!
+//! x An enum member cannot have a numeric name
+//! ,----
+//! 2 | 1, 2, 3
+//! : ^
+//! `----
+//!
+//! x An enum member cannot have a numeric name
+//! ,----
+//! 2 | 1, 2, 3
+//! : ^
+//! `----
+//!
+//! x An enum member cannot have a numeric name
+//! ,----
+//! 2 | 1, 2, 3
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserEnum7_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserEnum7_es2015.2.minified.js
new file mode 100644
index 000000000000..8e790aafcbb3
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserEnum7_es2015.2.minified.js
@@ -0,0 +1,24 @@
+//!
+//! x An enum member cannot have a numeric name
+//! ,----
+//! 2 | 1, 2, 3
+//! : ^
+//! `----
+//!
+//! x An enum member cannot have a numeric name
+//! ,----
+//! 2 | 1, 2, 3
+//! : ^
+//! `----
+//!
+//! x An enum member cannot have a numeric name
+//! ,----
+//! 2 | 1, 2, 3
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserEnum7_es5.1.normal.js b/crates/swc/tests/tsc-references/parserEnum7_es5.1.normal.js
new file mode 100644
index 000000000000..8e790aafcbb3
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserEnum7_es5.1.normal.js
@@ -0,0 +1,24 @@
+//!
+//! x An enum member cannot have a numeric name
+//! ,----
+//! 2 | 1, 2, 3
+//! : ^
+//! `----
+//!
+//! x An enum member cannot have a numeric name
+//! ,----
+//! 2 | 1, 2, 3
+//! : ^
+//! `----
+//!
+//! x An enum member cannot have a numeric name
+//! ,----
+//! 2 | 1, 2, 3
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserEnum7_es5.2.minified.js b/crates/swc/tests/tsc-references/parserEnum7_es5.2.minified.js
new file mode 100644
index 000000000000..8e790aafcbb3
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserEnum7_es5.2.minified.js
@@ -0,0 +1,24 @@
+//!
+//! x An enum member cannot have a numeric name
+//! ,----
+//! 2 | 1, 2, 3
+//! : ^
+//! `----
+//!
+//! x An enum member cannot have a numeric name
+//! ,----
+//! 2 | 1, 2, 3
+//! : ^
+//! `----
+//!
+//! x An enum member cannot have a numeric name
+//! ,----
+//! 2 | 1, 2, 3
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForInStatement5_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForInStatement5_es2015.1.normal.js
new file mode 100644
index 000000000000..1341d953b745
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForInStatement5_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 1 | for (var a: number in X) {
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForInStatement5_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserForInStatement5_es2015.2.minified.js
new file mode 100644
index 000000000000..1341d953b745
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForInStatement5_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 1 | for (var a: number in X) {
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForInStatement5_es5.1.normal.js b/crates/swc/tests/tsc-references/parserForInStatement5_es5.1.normal.js
new file mode 100644
index 000000000000..1341d953b745
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForInStatement5_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 1 | for (var a: number in X) {
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForInStatement5_es5.2.minified.js b/crates/swc/tests/tsc-references/parserForInStatement5_es5.2.minified.js
new file mode 100644
index 000000000000..1341d953b745
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForInStatement5_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 1 | for (var a: number in X) {
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForOfStatement23_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement23_es2015.1.normal.js
new file mode 100644
index 000000000000..27e4c5c34668
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForOfStatement23_es2015.1.normal.js
@@ -0,0 +1,11 @@
+//!
+//! x Expected '=>', got 'x'
+//! ,----
+//! 5 | for await (async of x) {}
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForOfStatement23_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserForOfStatement23_es2015.2.minified.js
new file mode 100644
index 000000000000..27e4c5c34668
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForOfStatement23_es2015.2.minified.js
@@ -0,0 +1,11 @@
+//!
+//! x Expected '=>', got 'x'
+//! ,----
+//! 5 | for await (async of x) {}
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForOfStatement23_es5.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement23_es5.1.normal.js
new file mode 100644
index 000000000000..27e4c5c34668
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForOfStatement23_es5.1.normal.js
@@ -0,0 +1,11 @@
+//!
+//! x Expected '=>', got 'x'
+//! ,----
+//! 5 | for await (async of x) {}
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForOfStatement23_es5.2.minified.js b/crates/swc/tests/tsc-references/parserForOfStatement23_es5.2.minified.js
new file mode 100644
index 000000000000..27e4c5c34668
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForOfStatement23_es5.2.minified.js
@@ -0,0 +1,11 @@
+//!
+//! x Expected '=>', got 'x'
+//! ,----
+//! 5 | for await (async of x) {}
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForOfStatement5_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement5_es2015.1.normal.js
new file mode 100644
index 000000000000..aa3e38d44eb7
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForOfStatement5_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 2 | for (var a: number of X) {
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForOfStatement5_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserForOfStatement5_es2015.2.minified.js
new file mode 100644
index 000000000000..aa3e38d44eb7
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForOfStatement5_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 2 | for (var a: number of X) {
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForOfStatement5_es5.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement5_es5.1.normal.js
new file mode 100644
index 000000000000..aa3e38d44eb7
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForOfStatement5_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 2 | for (var a: number of X) {
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForOfStatement5_es5.2.minified.js b/crates/swc/tests/tsc-references/parserForOfStatement5_es5.2.minified.js
new file mode 100644
index 000000000000..aa3e38d44eb7
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForOfStatement5_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...of' statement cannot use a type annotation
+//! ,----
+//! 2 | for (var a: number of X) {
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForStatement4_es2015.1.normal.js
new file mode 100644
index 000000000000..df0909a781cc
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement4_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (a = 1 in b) {
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement4_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserForStatement4_es2015.2.minified.js
new file mode 100644
index 000000000000..df0909a781cc
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement4_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (a = 1 in b) {
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement4_es5.1.normal.js b/crates/swc/tests/tsc-references/parserForStatement4_es5.1.normal.js
new file mode 100644
index 000000000000..df0909a781cc
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement4_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (a = 1 in b) {
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement4_es5.2.minified.js b/crates/swc/tests/tsc-references/parserForStatement4_es5.2.minified.js
new file mode 100644
index 000000000000..df0909a781cc
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement4_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (a = 1 in b) {
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement5_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForStatement5_es2015.1.normal.js
new file mode 100644
index 000000000000..c3b6dd05258e
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement5_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...in' statement cannot be a destructuring pattern
+//! ,----
+//! 1 | for ({} in b) {
+//! : ^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement5_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserForStatement5_es2015.2.minified.js
new file mode 100644
index 000000000000..c3b6dd05258e
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement5_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...in' statement cannot be a destructuring pattern
+//! ,----
+//! 1 | for ({} in b) {
+//! : ^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement5_es5.1.normal.js b/crates/swc/tests/tsc-references/parserForStatement5_es5.1.normal.js
new file mode 100644
index 000000000000..c3b6dd05258e
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement5_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...in' statement cannot be a destructuring pattern
+//! ,----
+//! 1 | for ({} in b) {
+//! : ^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement5_es5.2.minified.js b/crates/swc/tests/tsc-references/parserForStatement5_es5.2.minified.js
new file mode 100644
index 000000000000..c3b6dd05258e
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement5_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of a 'for...in' statement cannot be a destructuring pattern
+//! ,----
+//! 1 | for ({} in b) {
+//! : ^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement6_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForStatement6_es2015.1.normal.js
new file mode 100644
index 000000000000..ec34285f1817
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement6_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (foo() in b) {
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement6_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserForStatement6_es2015.2.minified.js
new file mode 100644
index 000000000000..ec34285f1817
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement6_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (foo() in b) {
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement6_es5.1.normal.js b/crates/swc/tests/tsc-references/parserForStatement6_es5.1.normal.js
new file mode 100644
index 000000000000..ec34285f1817
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement6_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (foo() in b) {
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement6_es5.2.minified.js b/crates/swc/tests/tsc-references/parserForStatement6_es5.2.minified.js
new file mode 100644
index 000000000000..ec34285f1817
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement6_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (foo() in b) {
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement7_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForStatement7_es2015.1.normal.js
new file mode 100644
index 000000000000..0f7046841102
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement7_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (new foo() in b) {
+//! : ^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement7_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserForStatement7_es2015.2.minified.js
new file mode 100644
index 000000000000..0f7046841102
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement7_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (new foo() in b) {
+//! : ^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement7_es5.1.normal.js b/crates/swc/tests/tsc-references/parserForStatement7_es5.1.normal.js
new file mode 100644
index 000000000000..0f7046841102
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement7_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (new foo() in b) {
+//! : ^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement7_es5.2.minified.js b/crates/swc/tests/tsc-references/parserForStatement7_es5.2.minified.js
new file mode 100644
index 000000000000..0f7046841102
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement7_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (new foo() in b) {
+//! : ^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement8_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserForStatement8_es2015.1.normal.js
new file mode 100644
index 000000000000..876d51f2e2c0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement8_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (this in b) {
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement8_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserForStatement8_es2015.2.minified.js
new file mode 100644
index 000000000000..876d51f2e2c0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement8_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (this in b) {
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement8_es5.1.normal.js b/crates/swc/tests/tsc-references/parserForStatement8_es5.1.normal.js
new file mode 100644
index 000000000000..876d51f2e2c0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement8_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (this in b) {
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserForStatement8_es5.2.minified.js b/crates/swc/tests/tsc-references/parserForStatement8_es5.2.minified.js
new file mode 100644
index 000000000000..876d51f2e2c0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserForStatement8_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | for (this in b) {
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserInterfaceDeclaration8_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserInterfaceDeclaration8_es2015.1.normal.js
new file mode 100644
index 000000000000..a75152f7e8d3
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserInterfaceDeclaration8_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x interface name is invalid
+//! ,----
+//! 1 | interface string {
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserInterfaceDeclaration8_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserInterfaceDeclaration8_es2015.2.minified.js
new file mode 100644
index 000000000000..a75152f7e8d3
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserInterfaceDeclaration8_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x interface name is invalid
+//! ,----
+//! 1 | interface string {
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserInterfaceDeclaration8_es5.1.normal.js b/crates/swc/tests/tsc-references/parserInterfaceDeclaration8_es5.1.normal.js
new file mode 100644
index 000000000000..a75152f7e8d3
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserInterfaceDeclaration8_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x interface name is invalid
+//! ,----
+//! 1 | interface string {
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserInterfaceDeclaration8_es5.2.minified.js b/crates/swc/tests/tsc-references/parserInterfaceDeclaration8_es5.2.minified.js
new file mode 100644
index 000000000000..a75152f7e8d3
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserInterfaceDeclaration8_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x interface name is invalid
+//! ,----
+//! 1 | interface string {
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration15_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration15_es2015.1.normal.js
new file mode 100644
index 000000000000..9bad4b7db658
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration15_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | set Foo(public a: number) { }
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration15_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration15_es2015.2.minified.js
new file mode 100644
index 000000000000..9bad4b7db658
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration15_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | set Foo(public a: number) { }
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration15_es5.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration15_es5.1.normal.js
new file mode 100644
index 000000000000..9bad4b7db658
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration15_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | set Foo(public a: number) { }
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration15_es5.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration15_es5.2.minified.js
new file mode 100644
index 000000000000..9bad4b7db658
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration15_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | set Foo(public a: number) { }
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList13_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList13_es2015.1.normal.js
new file mode 100644
index 000000000000..1b611715ec64
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList13_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | new (public x);
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList13_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList13_es2015.2.minified.js
new file mode 100644
index 000000000000..1b611715ec64
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList13_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | new (public x);
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList13_es5.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList13_es5.1.normal.js
new file mode 100644
index 000000000000..1b611715ec64
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList13_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | new (public x);
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList13_es5.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList13_es5.2.minified.js
new file mode 100644
index 000000000000..1b611715ec64
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList13_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | new (public x);
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList14_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList14_es2015.1.normal.js
new file mode 100644
index 000000000000..cd2413bc5d23
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList14_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | foo(a = 1): void;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList14_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList14_es2015.2.minified.js
new file mode 100644
index 000000000000..cd2413bc5d23
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList14_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | foo(a = 1): void;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList14_es5.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList14_es5.1.normal.js
new file mode 100644
index 000000000000..cd2413bc5d23
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList14_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | foo(a = 1): void;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList14_es5.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList14_es5.2.minified.js
new file mode 100644
index 000000000000..cd2413bc5d23
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList14_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | foo(a = 1): void;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList15_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList15_es2015.1.normal.js
new file mode 100644
index 000000000000..42723d881773
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList15_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 1 | function foo(a = 4);
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList15_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList15_es2015.2.minified.js
new file mode 100644
index 000000000000..42723d881773
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList15_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 1 | function foo(a = 4);
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList15_es5.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList15_es5.1.normal.js
new file mode 100644
index 000000000000..42723d881773
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList15_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 1 | function foo(a = 4);
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList15_es5.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList15_es5.2.minified.js
new file mode 100644
index 000000000000..42723d881773
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList15_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 1 | function foo(a = 4);
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList16_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList16_es2015.1.normal.js
new file mode 100644
index 000000000000..8eac4b2a2fe1
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList16_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | foo(a = 4);
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList16_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList16_es2015.2.minified.js
new file mode 100644
index 000000000000..8eac4b2a2fe1
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList16_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | foo(a = 4);
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList16_es5.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList16_es5.1.normal.js
new file mode 100644
index 000000000000..8eac4b2a2fe1
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList16_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | foo(a = 4);
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList16_es5.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList16_es5.2.minified.js
new file mode 100644
index 000000000000..8eac4b2a2fe1
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList16_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | foo(a = 4);
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList17_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList17_es2015.1.normal.js
new file mode 100644
index 000000000000..2ddd4b02dedb
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList17_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | constructor(a = 4);
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList17_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList17_es2015.2.minified.js
new file mode 100644
index 000000000000..2ddd4b02dedb
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList17_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | constructor(a = 4);
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList17_es5.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList17_es5.1.normal.js
new file mode 100644
index 000000000000..2ddd4b02dedb
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList17_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | constructor(a = 4);
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList17_es5.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList17_es5.2.minified.js
new file mode 100644
index 000000000000..2ddd4b02dedb
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList17_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter initializer is only allowed in a function or constructor implementation
+//! ,----
+//! 2 | constructor(a = 4);
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList4_es2015.1.normal.js
new file mode 100644
index 000000000000..2eebf91e4958
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList4_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 1 | function F(public A) {
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList4_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList4_es2015.2.minified.js
new file mode 100644
index 000000000000..2eebf91e4958
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList4_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 1 | function F(public A) {
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList4_es5.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList4_es5.1.normal.js
new file mode 100644
index 000000000000..2eebf91e4958
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList4_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 1 | function F(public A) {
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList4_es5.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList4_es5.2.minified.js
new file mode 100644
index 000000000000..2eebf91e4958
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList4_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 1 | function F(public A) {
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList5_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList5_es2015.1.normal.js
new file mode 100644
index 000000000000..94b43b342f7f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList5_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 1 | function A(): (public B) => C {
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList5_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList5_es2015.2.minified.js
new file mode 100644
index 000000000000..94b43b342f7f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList5_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 1 | function A(): (public B) => C {
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList5_es5.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList5_es5.1.normal.js
new file mode 100644
index 000000000000..94b43b342f7f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList5_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 1 | function A(): (public B) => C {
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList5_es5.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList5_es5.2.minified.js
new file mode 100644
index 000000000000..94b43b342f7f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList5_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 1 | function A(): (public B) => C {
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList6_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList6_es2015.1.normal.js
new file mode 100644
index 000000000000..3d258bf194f0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList6_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(C: (public A) => any) {
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList6_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList6_es2015.2.minified.js
new file mode 100644
index 000000000000..3d258bf194f0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList6_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(C: (public A) => any) {
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList6_es5.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList6_es5.1.normal.js
new file mode 100644
index 000000000000..3d258bf194f0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList6_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(C: (public A) => any) {
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList6_es5.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList6_es5.2.minified.js
new file mode 100644
index 000000000000..3d258bf194f0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList6_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(C: (public A) => any) {
+//! : ^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList7_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList7_es2015.1.normal.js
index 2ca2de960ead..0fdd642bface 100644
--- a/crates/swc/tests/tsc-references/parserParameterList7_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/parserParameterList7_es2015.1.normal.js
@@ -1,5 +1,18 @@
-class C1 {
- constructor(p3){
- this.p3 = p3;
- }
-}
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(public p1:string); // ERROR
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | constructor(private p2:number); // ERROR
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList7_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList7_es2015.2.minified.js
new file mode 100644
index 000000000000..0fdd642bface
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList7_es2015.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(public p1:string); // ERROR
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | constructor(private p2:number); // ERROR
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList7_es5.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList7_es5.1.normal.js
index 8c0848aa0d7e..0fdd642bface 100644
--- a/crates/swc/tests/tsc-references/parserParameterList7_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/parserParameterList7_es5.1.normal.js
@@ -1,6 +1,18 @@
-import * as swcHelpers from "@swc/helpers";
-var C1 = function C1(p3) {
- "use strict";
- swcHelpers.classCallCheck(this, C1);
- this.p3 = p3;
-};
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(public p1:string); // ERROR
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | constructor(private p2:number); // ERROR
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList7_es5.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList7_es5.2.minified.js
index fecabe0610a9..0fdd642bface 100644
--- a/crates/swc/tests/tsc-references/parserParameterList7_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/parserParameterList7_es5.2.minified.js
@@ -1,5 +1,18 @@
-import * as swcHelpers from "@swc/helpers";
-var C1 = function(p3) {
- "use strict";
- swcHelpers.classCallCheck(this, C1), this.p3 = p3;
-};
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(public p1:string); // ERROR
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | constructor(private p2:number); // ERROR
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList8_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList8_es2015.1.normal.js
new file mode 100644
index 000000000000..c0d2b96e7413
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList8_es2015.1.normal.js
@@ -0,0 +1,24 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(public p1:string); // ERROR
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | constructor(private p2:number); // ERROR
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 4 | constructor(public p3:any); // ERROR
+//! : ^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList8_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList8_es2015.2.minified.js
new file mode 100644
index 000000000000..c0d2b96e7413
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList8_es2015.2.minified.js
@@ -0,0 +1,24 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(public p1:string); // ERROR
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | constructor(private p2:number); // ERROR
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 4 | constructor(public p3:any); // ERROR
+//! : ^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList8_es5.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList8_es5.1.normal.js
new file mode 100644
index 000000000000..c0d2b96e7413
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList8_es5.1.normal.js
@@ -0,0 +1,24 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(public p1:string); // ERROR
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | constructor(private p2:number); // ERROR
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 4 | constructor(public p3:any); // ERROR
+//! : ^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserParameterList8_es5.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList8_es5.2.minified.js
new file mode 100644
index 000000000000..c0d2b96e7413
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserParameterList8_es5.2.minified.js
@@ -0,0 +1,24 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(public p1:string); // ERROR
+//! : ^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | constructor(private p2:number); // ERROR
+//! : ^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 4 | constructor(public p3:any); // ERROR
+//! : ^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es2015.1.normal.js
index ae718d5ab6b1..10e02f3d93e0 100644
--- a/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es2015.1.normal.js
@@ -1 +1,12 @@
-if (1) /regexp/a.foo();
+//!
+//! x Unknown regular expression flags.
+//! ,----
+//! 1 | if (1) /regexp/a.foo();
+//! : ^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es2015.2.minified.js
index 264af008dbb6..10e02f3d93e0 100644
--- a/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es2015.2.minified.js
@@ -1 +1,12 @@
-/regexp/a.foo();
+//!
+//! x Unknown regular expression flags.
+//! ,----
+//! 1 | if (1) /regexp/a.foo();
+//! : ^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es5.1.normal.js b/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es5.1.normal.js
index ae718d5ab6b1..10e02f3d93e0 100644
--- a/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es5.1.normal.js
@@ -1 +1,12 @@
-if (1) /regexp/a.foo();
+//!
+//! x Unknown regular expression flags.
+//! ,----
+//! 1 | if (1) /regexp/a.foo();
+//! : ^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es5.2.minified.js b/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es5.2.minified.js
index 264af008dbb6..10e02f3d93e0 100644
--- a/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity3_es5.2.minified.js
@@ -1 +1,12 @@
-/regexp/a.foo();
+//!
+//! x Unknown regular expression flags.
+//! ,----
+//! 1 | if (1) /regexp/a.foo();
+//! : ^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode16_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode16_es2015.1.normal.js
new file mode 100644
index 000000000000..e45c3697f962
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode16_es2015.1.normal.js
@@ -0,0 +1,30 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 2 | delete this;
+//! : ^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 3 | delete 1;
+//! : ^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 4 | delete null;
+//! : ^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 5 | delete "a";
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode16_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode16_es2015.2.minified.js
new file mode 100644
index 000000000000..e45c3697f962
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode16_es2015.2.minified.js
@@ -0,0 +1,30 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 2 | delete this;
+//! : ^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 3 | delete 1;
+//! : ^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 4 | delete null;
+//! : ^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 5 | delete "a";
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode16_es5.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode16_es5.1.normal.js
new file mode 100644
index 000000000000..e45c3697f962
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode16_es5.1.normal.js
@@ -0,0 +1,30 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 2 | delete this;
+//! : ^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 3 | delete 1;
+//! : ^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 4 | delete null;
+//! : ^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 5 | delete "a";
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode16_es5.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode16_es5.2.minified.js
new file mode 100644
index 000000000000..e45c3697f962
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode16_es5.2.minified.js
@@ -0,0 +1,30 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 2 | delete this;
+//! : ^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 3 | delete 1;
+//! : ^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 4 | delete null;
+//! : ^^^^
+//! `----
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 5 | delete "a";
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode1_es2015.1.normal.js
new file mode 100644
index 000000000000..26268a36e3fb
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode1_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 4 | static();
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode1_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode1_es2015.2.minified.js
new file mode 100644
index 000000000000..26268a36e3fb
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode1_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 4 | static();
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode1_es5.1.normal.js
new file mode 100644
index 000000000000..26268a36e3fb
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode1_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 4 | static();
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode1_es5.2.minified.js
new file mode 100644
index 000000000000..26268a36e3fb
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode1_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', or 'yield' cannot be used as an identifier in strict mode
+//! ,----
+//! 4 | static();
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode3-negative_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode3-negative_es2015.1.normal.js
new file mode 100644
index 000000000000..675ea99f0609
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode3-negative_es2015.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | eval = 1;
+//! : ^^^^
+//! `----
+//!
+//! x Invalid use of 'arguments' in strict mode
+//! ,----
+//! 1 | eval = 1;
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode3-negative_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode3-negative_es2015.2.minified.js
new file mode 100644
index 000000000000..675ea99f0609
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode3-negative_es2015.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | eval = 1;
+//! : ^^^^
+//! `----
+//!
+//! x Invalid use of 'arguments' in strict mode
+//! ,----
+//! 1 | eval = 1;
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode3-negative_es5.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode3-negative_es5.1.normal.js
new file mode 100644
index 000000000000..675ea99f0609
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode3-negative_es5.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | eval = 1;
+//! : ^^^^
+//! `----
+//!
+//! x Invalid use of 'arguments' in strict mode
+//! ,----
+//! 1 | eval = 1;
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode3-negative_es5.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode3-negative_es5.2.minified.js
new file mode 100644
index 000000000000..675ea99f0609
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode3-negative_es5.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | eval = 1;
+//! : ^^^^
+//! `----
+//!
+//! x Invalid use of 'arguments' in strict mode
+//! ,----
+//! 1 | eval = 1;
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode6-negative_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode6-negative_es2015.1.normal.js
new file mode 100644
index 000000000000..d02aa67f19b2
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode6-negative_es2015.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | eval++;
+//! : ^^^^
+//! `----
+//!
+//! x Invalid use of 'arguments' in strict mode
+//! ,----
+//! 1 | eval++;
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode6-negative_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode6-negative_es2015.2.minified.js
new file mode 100644
index 000000000000..d02aa67f19b2
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode6-negative_es2015.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | eval++;
+//! : ^^^^
+//! `----
+//!
+//! x Invalid use of 'arguments' in strict mode
+//! ,----
+//! 1 | eval++;
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode6-negative_es5.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode6-negative_es5.1.normal.js
new file mode 100644
index 000000000000..d02aa67f19b2
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode6-negative_es5.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | eval++;
+//! : ^^^^
+//! `----
+//!
+//! x Invalid use of 'arguments' in strict mode
+//! ,----
+//! 1 | eval++;
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserStrictMode6-negative_es5.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode6-negative_es5.2.minified.js
new file mode 100644
index 000000000000..d02aa67f19b2
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserStrictMode6-negative_es5.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | eval++;
+//! : ^^^^
+//! `----
+//!
+//! x Invalid use of 'arguments' in strict mode
+//! ,----
+//! 1 | eval++;
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserSuperExpression2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserSuperExpression2_es2015.1.normal.js
new file mode 100644
index 000000000000..5d81b5c74f07
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserSuperExpression2_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x Expression expected
+//! ,----
+//! 3 | super(0);
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserSuperExpression2_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserSuperExpression2_es2015.2.minified.js
new file mode 100644
index 000000000000..5d81b5c74f07
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserSuperExpression2_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x Expression expected
+//! ,----
+//! 3 | super(0);
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserSuperExpression2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserSuperExpression2_es5.1.normal.js
new file mode 100644
index 000000000000..5d81b5c74f07
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserSuperExpression2_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x Expression expected
+//! ,----
+//! 3 | super(0);
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserSuperExpression2_es5.2.minified.js b/crates/swc/tests/tsc-references/parserSuperExpression2_es5.2.minified.js
new file mode 100644
index 000000000000..5d81b5c74f07
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserSuperExpression2_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x Expression expected
+//! ,----
+//! 3 | super(0);
+//! : ^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression1_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserUnaryExpression1_es2015.1.normal.js
new file mode 100644
index 000000000000..7b9a69f1386c
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression1_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++this;
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression1_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserUnaryExpression1_es2015.2.minified.js
new file mode 100644
index 000000000000..7b9a69f1386c
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression1_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++this;
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression1_es5.1.normal.js b/crates/swc/tests/tsc-references/parserUnaryExpression1_es5.1.normal.js
new file mode 100644
index 000000000000..7b9a69f1386c
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression1_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++this;
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression1_es5.2.minified.js b/crates/swc/tests/tsc-references/parserUnaryExpression1_es5.2.minified.js
new file mode 100644
index 000000000000..7b9a69f1386c
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression1_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++this;
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserUnaryExpression2_es2015.1.normal.js
new file mode 100644
index 000000000000..21b06af2315e
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression2_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++function(e) { }
+//! : ^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression2_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserUnaryExpression2_es2015.2.minified.js
new file mode 100644
index 000000000000..21b06af2315e
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression2_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++function(e) { }
+//! : ^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserUnaryExpression2_es5.1.normal.js
new file mode 100644
index 000000000000..21b06af2315e
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression2_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++function(e) { }
+//! : ^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression2_es5.2.minified.js b/crates/swc/tests/tsc-references/parserUnaryExpression2_es5.2.minified.js
new file mode 100644
index 000000000000..21b06af2315e
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression2_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++function(e) { }
+//! : ^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression3_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserUnaryExpression3_es2015.1.normal.js
new file mode 100644
index 000000000000..ca475bdf3277
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression3_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++[0];
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression3_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserUnaryExpression3_es2015.2.minified.js
new file mode 100644
index 000000000000..ca475bdf3277
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression3_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++[0];
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression3_es5.1.normal.js b/crates/swc/tests/tsc-references/parserUnaryExpression3_es5.1.normal.js
new file mode 100644
index 000000000000..ca475bdf3277
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression3_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++[0];
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression3_es5.2.minified.js b/crates/swc/tests/tsc-references/parserUnaryExpression3_es5.2.minified.js
new file mode 100644
index 000000000000..ca475bdf3277
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression3_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++[0];
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression4_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserUnaryExpression4_es2015.1.normal.js
new file mode 100644
index 000000000000..34ce0f4aa7e1
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression4_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++{};
+//! : ^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression4_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserUnaryExpression4_es2015.2.minified.js
new file mode 100644
index 000000000000..34ce0f4aa7e1
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression4_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++{};
+//! : ^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression4_es5.1.normal.js b/crates/swc/tests/tsc-references/parserUnaryExpression4_es5.1.normal.js
new file mode 100644
index 000000000000..34ce0f4aa7e1
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression4_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++{};
+//! : ^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression4_es5.2.minified.js b/crates/swc/tests/tsc-references/parserUnaryExpression4_es5.2.minified.js
new file mode 100644
index 000000000000..34ce0f4aa7e1
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression4_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++{};
+//! : ^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression7_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserUnaryExpression7_es2015.1.normal.js
new file mode 100644
index 000000000000..b1a75c70ab95
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression7_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++ new Foo();
+//! : ^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression7_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserUnaryExpression7_es2015.2.minified.js
new file mode 100644
index 000000000000..b1a75c70ab95
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression7_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++ new Foo();
+//! : ^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression7_es5.1.normal.js b/crates/swc/tests/tsc-references/parserUnaryExpression7_es5.1.normal.js
new file mode 100644
index 000000000000..b1a75c70ab95
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression7_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++ new Foo();
+//! : ^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression7_es5.2.minified.js b/crates/swc/tests/tsc-references/parserUnaryExpression7_es5.2.minified.js
new file mode 100644
index 000000000000..b1a75c70ab95
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserUnaryExpression7_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The left-hand side of an assignment expression must be a variable or a property access.
+//! ,----
+//! 1 | ++ new Foo();
+//! : ^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserWithStatement2_es2015.1.normal.js b/crates/swc/tests/tsc-references/parserWithStatement2_es2015.1.normal.js
new file mode 100644
index 000000000000..f5dac3135a55
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserWithStatement2_es2015.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
+//! ,----
+//! 1 | with (1)
+//! : ^^^^
+//! `----
+//!
+//! x With statement are not allowed in strict mode
+//! ,----
+//! 1 | with (1)
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserWithStatement2_es2015.2.minified.js b/crates/swc/tests/tsc-references/parserWithStatement2_es2015.2.minified.js
new file mode 100644
index 000000000000..f5dac3135a55
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserWithStatement2_es2015.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
+//! ,----
+//! 1 | with (1)
+//! : ^^^^
+//! `----
+//!
+//! x With statement are not allowed in strict mode
+//! ,----
+//! 1 | with (1)
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserWithStatement2_es5.1.normal.js b/crates/swc/tests/tsc-references/parserWithStatement2_es5.1.normal.js
new file mode 100644
index 000000000000..f5dac3135a55
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserWithStatement2_es5.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
+//! ,----
+//! 1 | with (1)
+//! : ^^^^
+//! `----
+//!
+//! x With statement are not allowed in strict mode
+//! ,----
+//! 1 | with (1)
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/parserWithStatement2_es5.2.minified.js b/crates/swc/tests/tsc-references/parserWithStatement2_es5.2.minified.js
new file mode 100644
index 000000000000..f5dac3135a55
--- /dev/null
+++ b/crates/swc/tests/tsc-references/parserWithStatement2_es5.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
+//! ,----
+//! 1 | with (1)
+//! : ^^^^
+//! `----
+//!
+//! x With statement are not allowed in strict mode
+//! ,----
+//! 1 | with (1)
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/plainJSRedeclare2_es2015.1.normal.js b/crates/swc/tests/tsc-references/plainJSRedeclare2_es2015.1.normal.js
index 1d50d10cbd3d..dc43cf99662e 100644
--- a/crates/swc/tests/tsc-references/plainJSRedeclare2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/plainJSRedeclare2_es2015.1.normal.js
@@ -2,6 +2,13 @@
// @allowJS: true
// @checkJS: true
// @filename: plainJSRedeclare.js
-const orbitol = 1;
-var orbitol = 1 + false;
-orbitol.toExponential();
+//!
+//! x the name `orbitol` is defined multiple times
+//! ,-[2:1]
+//! 2 | const orbitol = 1
+//! : ^^^|^^^
+//! : `-- previous definition of `orbitol` here
+//! 3 | var orbitol = 1 + false
+//! : ^^^|^^^
+//! : `-- `orbitol` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/plainJSRedeclare2_es2015.2.minified.js b/crates/swc/tests/tsc-references/plainJSRedeclare2_es2015.2.minified.js
index a024fec1c929..491b6ced8dad 100644
--- a/crates/swc/tests/tsc-references/plainJSRedeclare2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/plainJSRedeclare2_es2015.2.minified.js
@@ -1,3 +1,11 @@
-const orbitol = 1;
-var orbitol = 1;
-orbitol.toExponential();
+// @filename: plainJSRedeclare.js
+//!
+//! x the name `orbitol` is defined multiple times
+//! ,-[2:1]
+//! 2 | const orbitol = 1
+//! : ^^^|^^^
+//! : `-- previous definition of `orbitol` here
+//! 3 | var orbitol = 1 + false
+//! : ^^^|^^^
+//! : `-- `orbitol` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/plainJSRedeclare2_es5.1.normal.js b/crates/swc/tests/tsc-references/plainJSRedeclare2_es5.1.normal.js
index 9429f89011d0..dc43cf99662e 100644
--- a/crates/swc/tests/tsc-references/plainJSRedeclare2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/plainJSRedeclare2_es5.1.normal.js
@@ -2,6 +2,13 @@
// @allowJS: true
// @checkJS: true
// @filename: plainJSRedeclare.js
-var orbitol = 1;
-var orbitol = 1 + false;
-orbitol.toExponential();
+//!
+//! x the name `orbitol` is defined multiple times
+//! ,-[2:1]
+//! 2 | const orbitol = 1
+//! : ^^^|^^^
+//! : `-- previous definition of `orbitol` here
+//! 3 | var orbitol = 1 + false
+//! : ^^^|^^^
+//! : `-- `orbitol` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/plainJSRedeclare2_es5.2.minified.js b/crates/swc/tests/tsc-references/plainJSRedeclare2_es5.2.minified.js
index c1d01a3a320e..491b6ced8dad 100644
--- a/crates/swc/tests/tsc-references/plainJSRedeclare2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/plainJSRedeclare2_es5.2.minified.js
@@ -1 +1,11 @@
-1..toExponential();
+// @filename: plainJSRedeclare.js
+//!
+//! x the name `orbitol` is defined multiple times
+//! ,-[2:1]
+//! 2 | const orbitol = 1
+//! : ^^^|^^^
+//! : `-- previous definition of `orbitol` here
+//! 3 | var orbitol = 1 + false
+//! : ^^^|^^^
+//! : `-- `orbitol` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/plainJSRedeclare3_es2015.1.normal.js b/crates/swc/tests/tsc-references/plainJSRedeclare3_es2015.1.normal.js
index 33de95f69815..1fcb4a34efeb 100644
--- a/crates/swc/tests/tsc-references/plainJSRedeclare3_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/plainJSRedeclare3_es2015.1.normal.js
@@ -2,6 +2,13 @@
// @allowJS: true
// @checkJS: false
// @filename: plainJSRedeclare.js
-const orbitol = 1;
-var orbitol = 1 + false;
-orbitol.toExponential();
+//!
+//! x the name `orbitol` is defined multiple times
+//! ,-[2:1]
+//! 2 | const orbitol = 1
+//! : ^^^|^^^
+//! : `-- previous definition of `orbitol` here
+//! 3 | var orbitol = 1 + false
+//! : ^^^|^^^
+//! : `-- `orbitol` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/plainJSRedeclare3_es2015.2.minified.js b/crates/swc/tests/tsc-references/plainJSRedeclare3_es2015.2.minified.js
index a024fec1c929..491b6ced8dad 100644
--- a/crates/swc/tests/tsc-references/plainJSRedeclare3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/plainJSRedeclare3_es2015.2.minified.js
@@ -1,3 +1,11 @@
-const orbitol = 1;
-var orbitol = 1;
-orbitol.toExponential();
+// @filename: plainJSRedeclare.js
+//!
+//! x the name `orbitol` is defined multiple times
+//! ,-[2:1]
+//! 2 | const orbitol = 1
+//! : ^^^|^^^
+//! : `-- previous definition of `orbitol` here
+//! 3 | var orbitol = 1 + false
+//! : ^^^|^^^
+//! : `-- `orbitol` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/plainJSRedeclare3_es5.1.normal.js b/crates/swc/tests/tsc-references/plainJSRedeclare3_es5.1.normal.js
index 182c5d306bbe..1fcb4a34efeb 100644
--- a/crates/swc/tests/tsc-references/plainJSRedeclare3_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/plainJSRedeclare3_es5.1.normal.js
@@ -2,6 +2,13 @@
// @allowJS: true
// @checkJS: false
// @filename: plainJSRedeclare.js
-var orbitol = 1;
-var orbitol = 1 + false;
-orbitol.toExponential();
+//!
+//! x the name `orbitol` is defined multiple times
+//! ,-[2:1]
+//! 2 | const orbitol = 1
+//! : ^^^|^^^
+//! : `-- previous definition of `orbitol` here
+//! 3 | var orbitol = 1 + false
+//! : ^^^|^^^
+//! : `-- `orbitol` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/plainJSRedeclare3_es5.2.minified.js b/crates/swc/tests/tsc-references/plainJSRedeclare3_es5.2.minified.js
index c1d01a3a320e..491b6ced8dad 100644
--- a/crates/swc/tests/tsc-references/plainJSRedeclare3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/plainJSRedeclare3_es5.2.minified.js
@@ -1 +1,11 @@
-1..toExponential();
+// @filename: plainJSRedeclare.js
+//!
+//! x the name `orbitol` is defined multiple times
+//! ,-[2:1]
+//! 2 | const orbitol = 1
+//! : ^^^|^^^
+//! : `-- previous definition of `orbitol` here
+//! 3 | var orbitol = 1 + false
+//! : ^^^|^^^
+//! : `-- `orbitol` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/plainJSRedeclare_es2015.1.normal.js b/crates/swc/tests/tsc-references/plainJSRedeclare_es2015.1.normal.js
index bbf1c378d056..a7acb604bd74 100644
--- a/crates/swc/tests/tsc-references/plainJSRedeclare_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/plainJSRedeclare_es2015.1.normal.js
@@ -1,6 +1,13 @@
// @outdir: out/
// @allowJS: true
// @filename: plainJSRedeclare.js
-const orbitol = 1;
-var orbitol = 1 + false;
-orbitol.toExponential();
+//!
+//! x the name `orbitol` is defined multiple times
+//! ,-[2:1]
+//! 2 | const orbitol = 1
+//! : ^^^|^^^
+//! : `-- previous definition of `orbitol` here
+//! 3 | var orbitol = 1 + false
+//! : ^^^|^^^
+//! : `-- `orbitol` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/plainJSRedeclare_es2015.2.minified.js b/crates/swc/tests/tsc-references/plainJSRedeclare_es2015.2.minified.js
index a024fec1c929..491b6ced8dad 100644
--- a/crates/swc/tests/tsc-references/plainJSRedeclare_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/plainJSRedeclare_es2015.2.minified.js
@@ -1,3 +1,11 @@
-const orbitol = 1;
-var orbitol = 1;
-orbitol.toExponential();
+// @filename: plainJSRedeclare.js
+//!
+//! x the name `orbitol` is defined multiple times
+//! ,-[2:1]
+//! 2 | const orbitol = 1
+//! : ^^^|^^^
+//! : `-- previous definition of `orbitol` here
+//! 3 | var orbitol = 1 + false
+//! : ^^^|^^^
+//! : `-- `orbitol` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/plainJSRedeclare_es5.1.normal.js b/crates/swc/tests/tsc-references/plainJSRedeclare_es5.1.normal.js
index 21a100a46a2e..a7acb604bd74 100644
--- a/crates/swc/tests/tsc-references/plainJSRedeclare_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/plainJSRedeclare_es5.1.normal.js
@@ -1,6 +1,13 @@
// @outdir: out/
// @allowJS: true
// @filename: plainJSRedeclare.js
-var orbitol = 1;
-var orbitol = 1 + false;
-orbitol.toExponential();
+//!
+//! x the name `orbitol` is defined multiple times
+//! ,-[2:1]
+//! 2 | const orbitol = 1
+//! : ^^^|^^^
+//! : `-- previous definition of `orbitol` here
+//! 3 | var orbitol = 1 + false
+//! : ^^^|^^^
+//! : `-- `orbitol` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/plainJSRedeclare_es5.2.minified.js b/crates/swc/tests/tsc-references/plainJSRedeclare_es5.2.minified.js
index c1d01a3a320e..491b6ced8dad 100644
--- a/crates/swc/tests/tsc-references/plainJSRedeclare_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/plainJSRedeclare_es5.2.minified.js
@@ -1 +1,11 @@
-1..toExponential();
+// @filename: plainJSRedeclare.js
+//!
+//! x the name `orbitol` is defined multiple times
+//! ,-[2:1]
+//! 2 | const orbitol = 1
+//! : ^^^|^^^
+//! : `-- previous definition of `orbitol` here
+//! 3 | var orbitol = 1 + false
+//! : ^^^|^^^
+//! : `-- `orbitol` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_errors_es2015.1.normal.js b/crates/swc/tests/tsc-references/preserveValueImports_errors_es2015.1.normal.js
index 56edff235be4..92b7e4566cfa 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_errors_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_errors_es2015.1.normal.js
@@ -2,13 +2,25 @@
// @isolatedModules: true,false
// @module: esnext
// @Filename: a.ts
+export { };
// @Filename: b.ts
class B {
}
-import { A } from "./a";
+export { };
+// @Filename: c.ts
+export { };
+// @Filename: c.fixed.ts
+export { };
// @Filename: d.ts
export { A as AA } from "./a";
export { B as BB } from "./b";
+// @Filename: d.fixed.ts
+export { };
// @Filename: e.ts
-import { BB } from "./d";
-export { B as BB };
+export { };
+// @Filename: e.fixed.ts
+export { };
+// @Filename: f.ts
+export { };
+// @Filename: f.fixed.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_errors_es2015.2.minified.js b/crates/swc/tests/tsc-references/preserveValueImports_errors_es2015.2.minified.js
index cf4282932cc8..9f1718f6ea74 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_errors_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_errors_es2015.2.minified.js
@@ -1,7 +1,11 @@
-class B {
-}
-import { A } from "./a";
+export { };
+export { };
+export { };
+export { };
export { A as AA } from "./a";
export { B as BB } from "./b";
-import { BB } from "./d";
-export { B as BB };
+export { };
+export { };
+export { };
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_errors_es5.1.normal.js b/crates/swc/tests/tsc-references/preserveValueImports_errors_es5.1.normal.js
index 5c5df363b359..ccb93fdd5328 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_errors_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_errors_es5.1.normal.js
@@ -2,16 +2,28 @@
// @isolatedModules: true,false
// @module: esnext
// @Filename: a.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+export { };
// @Filename: b.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var B = function B() {
"use strict";
_class_call_check(this, B);
};
-import { A } from "./a";
+export { };
+// @Filename: c.ts
+export { };
+// @Filename: c.fixed.ts
+export { };
// @Filename: d.ts
export { A as AA } from "./a";
export { B as BB } from "./b";
+// @Filename: d.fixed.ts
+export { };
// @Filename: e.ts
-import { BB } from "./d";
-export { B as BB };
+export { };
+// @Filename: e.fixed.ts
+export { };
+// @Filename: f.ts
+export { };
+// @Filename: f.fixed.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_errors_es5.2.minified.js b/crates/swc/tests/tsc-references/preserveValueImports_errors_es5.2.minified.js
index 9e753db05334..c56defb0d4b5 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_errors_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_errors_es5.2.minified.js
@@ -1,10 +1,15 @@
+export { };
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var B = function() {
"use strict";
_class_call_check(this, B);
};
-import { A } from "./a";
+export { };
+export { };
export { A as AA } from "./a";
export { B as BB } from "./b";
-import { BB } from "./d";
-export { B as BB };
+export { };
+export { };
+export { };
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_es2015.1.normal.js b/crates/swc/tests/tsc-references/preserveValueImports_es2015.1.normal.js
index 77a245828e11..aa62a1f28aa4 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_es2015.1.normal.js
@@ -6,11 +6,17 @@ export default {};
export const b = 0;
export const c = 1;
// @Filename: b.ts
-import { D } from "./a";
+export { };
+// @Filename: c.ts
+export { };
+// @Filename: d.ts
+module.exports = {};
+export { };
// @Filename: e.ts
const D = require("./d");
const DD = require("./d");
DD;
+export { };
+// @Filename: f.ts
+import { b } from "./a";
b;
-// @Filename: d.ts
-module.exports = {};
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_es2015.2.minified.js b/crates/swc/tests/tsc-references/preserveValueImports_es2015.2.minified.js
index ec85d7c4a284..4106d7890407 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_es2015.2.minified.js
@@ -1,5 +1,10 @@
export default {};
export const b = 0;
export const c = 1;
-import { D } from "./a";
-require("./d"), require("./d"), module.exports = {};
+export { };
+export { };
+module.exports = {};
+export { };
+require("./d"), require("./d");
+export { };
+import { b } from "./a";
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_es5.1.normal.js b/crates/swc/tests/tsc-references/preserveValueImports_es5.1.normal.js
index ff2f0aa416d7..8257d6ebb544 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_es5.1.normal.js
@@ -6,11 +6,17 @@ export default {};
export var b = 0;
export var c = 1;
// @Filename: b.ts
-import { D } from "./a";
+export { };
+// @Filename: c.ts
+export { };
+// @Filename: d.ts
+module.exports = {};
+export { };
// @Filename: e.ts
var D = require("./d");
var DD = require("./d");
DD;
+export { };
+// @Filename: f.ts
+import { b } from "./a";
b;
-// @Filename: d.ts
-module.exports = {};
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_es5.2.minified.js b/crates/swc/tests/tsc-references/preserveValueImports_es5.2.minified.js
index 3510bae5e97f..c1b7ccf3330f 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_es5.2.minified.js
@@ -1,5 +1,10 @@
export default {};
export var b = 0;
export var c = 1;
-import { D } from "./a";
-require("./d"), require("./d"), module.exports = {};
+export { };
+export { };
+module.exports = {};
+export { };
+require("./d"), require("./d");
+export { };
+import { b } from "./a";
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es2015.1.normal.js b/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es2015.1.normal.js
index 6c59b8fca279..2af3c99f1411 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es2015.1.normal.js
@@ -3,3 +3,7 @@
// @module: esnext
// @Filename: /mod.ts
export { };
+// @Filename: /index.ts
+export { };
+// @Filename: /reexport.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es2015.2.minified.js b/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es2015.2.minified.js
index 2234b9cae16d..f109f4c5600e 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es2015.2.minified.js
@@ -1 +1,3 @@
export { };
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es5.1.normal.js b/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es5.1.normal.js
index 6c59b8fca279..2af3c99f1411 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es5.1.normal.js
@@ -3,3 +3,7 @@
// @module: esnext
// @Filename: /mod.ts
export { };
+// @Filename: /index.ts
+export { };
+// @Filename: /reexport.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es5.2.minified.js b/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es5.2.minified.js
index 2234b9cae16d..f109f4c5600e 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_importsNotUsedAsValues_es5.2.minified.js
@@ -1 +1,3 @@
export { };
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es2015.1.normal.js b/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es2015.1.normal.js
index 091f5c3c0568..e688b59e74fd 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es2015.1.normal.js
@@ -3,3 +3,7 @@
// @module: es2015
// @Filename: /exports.ts
export function Component() {}
+// @Filename: /index.ts
+export { };
+// @Filename: /index.fixed.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es2015.2.minified.js b/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es2015.2.minified.js
index b6de3aa66251..d3fa525919ea 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es2015.2.minified.js
@@ -1 +1,3 @@
export function Component() {}
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es5.1.normal.js b/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es5.1.normal.js
index 091f5c3c0568..e688b59e74fd 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es5.1.normal.js
@@ -3,3 +3,7 @@
// @module: es2015
// @Filename: /exports.ts
export function Component() {}
+// @Filename: /index.ts
+export { };
+// @Filename: /index.fixed.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es5.2.minified.js b/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es5.2.minified.js
index b6de3aa66251..d3fa525919ea 100644
--- a/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/preserveValueImports_mixedImports_es5.2.minified.js
@@ -1 +1,3 @@
export function Component() {}
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/privateNameDuplicateField_es2015.1.normal.js b/crates/swc/tests/tsc-references/privateNameDuplicateField_es2015.1.normal.js
index b01b444db534..f656bd3e63ae 100644
--- a/crates/swc/tests/tsc-references/privateNameDuplicateField_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/privateNameDuplicateField_es2015.1.normal.js
@@ -1,878 +1,360 @@
-// @strict: true
-// @target: es6
-import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs";
-import _class_private_method_init from "@swc/helpers/src/_class_private_method_init.mjs";
-function Field() {
- var _foo = /*#__PURE__*/ new WeakMap(), _foo = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Field_Field {
- constructor(){
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- }
- }
- var _foo1 = /*#__PURE__*/ new WeakMap(), _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- class A_Field_Method {
- constructor(){
- _class_private_method_init(this, _foo1);
- _class_private_field_init(this, _foo1, {
- writable: true,
- value: "foo"
- });
- }
- }
- function foo() {}
- var _foo2 = /*#__PURE__*/ new WeakMap(), _foo2 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Field_Getter {
- constructor(){
- _class_private_field_init(this, _foo2, {
- get: get_foo,
- set: void 0
- });
- _class_private_field_init(this, _foo2, {
- writable: true,
- value: "foo"
- });
- }
- }
- function get_foo() {
- return "";
- }
- var _foo3 = /*#__PURE__*/ new WeakMap(), _foo3 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Field_Setter {
- constructor(){
- _class_private_field_init(this, _foo3, {
- get: void 0,
- set: set_foo
- });
- _class_private_field_init(this, _foo3, {
- writable: true,
- value: "foo"
- });
- }
- }
- function set_foo(value) {}
- var _foo4 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Field_StaticField {
- constructor(){
- _class_private_field_init(this, _foo4, {
- writable: true,
- value: "foo"
- });
- }
- }
- var _foo4 = {
- writable: true,
- value: "foo"
- };
- var _foo5 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Field_StaticMethod {
- constructor(){
- _class_private_field_init(this, _foo5, {
- writable: true,
- value: "foo"
- });
- }
- }
- function foo1() {}
- var _foo6 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Field_StaticGetter {
- constructor(){
- _class_private_field_init(this, _foo6, {
- writable: true,
- value: "foo"
- });
- }
- }
- var _foo6 = {
- get: get_foo1,
- set: void 0
- };
- function get_foo1() {
- return "";
- }
- var _foo7 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Field_StaticSetter {
- constructor(){
- _class_private_field_init(this, _foo7, {
- writable: true,
- value: "foo"
- });
- }
- }
- var _foo7 = {
- get: void 0,
- set: set_foo1
- };
- function set_foo1(value) {}
-}
-function Method() {
- var _foo = /*#__PURE__*/ new WeakSet(), _foo = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Method_Field {
- constructor(){
- _class_private_method_init(this, _foo);
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- }
- }
- function foo() {}
- var _foo1 = /*#__PURE__*/ new WeakSet(), _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- class A_Method_Method {
- constructor(){
- _class_private_method_init(this, _foo1);
- _class_private_method_init(this, _foo1);
- }
- }
- function foo1() {}
- function foo1() {}
- var _foo2 = /*#__PURE__*/ new WeakSet(), _foo2 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Method_Getter {
- constructor(){
- _class_private_method_init(this, _foo2);
- _class_private_field_init(this, _foo2, {
- get: get_foo,
- set: void 0
- });
- }
- }
- function foo2() {}
- function get_foo() {
- return "";
- }
- var _foo3 = /*#__PURE__*/ new WeakSet(), _foo3 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Method_Setter {
- constructor(){
- _class_private_method_init(this, _foo3);
- _class_private_field_init(this, _foo3, {
- get: void 0,
- set: set_foo
- });
- }
- }
- function foo3() {}
- function set_foo(value) {}
- var _foo4 = /*#__PURE__*/ new WeakSet();
- // Error
- class A_Method_StaticField {
- constructor(){
- _class_private_method_init(this, _foo4);
- }
- }
- var _foo4 = {
- writable: true,
- value: "foo"
- };
- function foo4() {}
- var _foo5 = /*#__PURE__*/ new WeakSet();
- // Error
- class A_Method_StaticMethod {
- constructor(){
- _class_private_method_init(this, _foo5);
- }
- }
- function foo5() {}
- function foo5() {}
- var _foo6 = /*#__PURE__*/ new WeakSet();
- // Error
- class A_Method_StaticGetter {
- constructor(){
- _class_private_method_init(this, _foo6);
- }
- }
- var _foo6 = {
- get: get_foo1,
- set: void 0
- };
- function foo6() {}
- function get_foo1() {
- return "";
- }
- var _foo7 = /*#__PURE__*/ new WeakSet();
- // Error
- class A_Method_StaticSetter {
- constructor(){
- _class_private_method_init(this, _foo7);
- }
- }
- var _foo7 = {
- get: void 0,
- set: set_foo1
- };
- function foo7() {}
- function set_foo1(value) {}
-}
-function Getter() {
- var _foo = /*#__PURE__*/ new WeakMap(), _foo = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Getter_Field {
- constructor(){
- _class_private_field_init(this, _foo, {
- get: get_foo,
- set: void 0
- });
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- }
- }
- function get_foo() {
- return "";
- }
- var _foo1 = /*#__PURE__*/ new WeakMap(), _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- class A_Getter_Method {
- constructor(){
- _class_private_field_init(this, _foo1, {
- get: get_foo1,
- set: void 0
- });
- _class_private_method_init(this, _foo1);
- }
- }
- function get_foo1() {
- return "";
- }
- function foo() {}
- var _foo2 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Getter_Getter {
- constructor(){
- _class_private_field_init(this, _foo2, {
- get: get_foo2,
- set: void 0
- });
- }
- }
- function get_foo2() {
- return "";
- }
- function get_foo2() {
- return "";
- }
- var _foo3 = /*#__PURE__*/ new WeakMap();
- //OK
- class A_Getter_Setter {
- constructor(){
- _class_private_field_init(this, _foo3, {
- get: get_foo3,
- set: set_foo
- });
- }
- }
- function get_foo3() {
- return "";
- }
- function set_foo(value) {}
- var _foo4 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Getter_StaticField {
- constructor(){
- _class_private_field_init(this, _foo4, {
- get: get_foo4,
- set: void 0
- });
- }
- }
- function get_foo4() {
- return "";
- }
- function foo1() {}
- var _foo5 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Getter_StaticMethod {
- constructor(){
- _class_private_field_init(this, _foo5, {
- get: get_foo5,
- set: void 0
- });
- }
- }
- function get_foo5() {
- return "";
- }
- function foo2() {}
- var _foo6 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Getter_StaticGetter {
- constructor(){
- _class_private_field_init(this, _foo6, {
- get: get_foo6,
- set: void 0
- });
- }
- }
- var _foo6 = {
- get: get_foo6,
- set: void 0
- };
- function get_foo6() {
- return "";
- }
- function get_foo6() {
- return "";
- }
- var _foo7 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Getter_StaticSetter {
- constructor(){
- _class_private_field_init(this, _foo7, {
- get: get_foo7,
- set: void 0
- });
- }
- }
- var _foo7 = {
- get: void 0,
- set: set_foo1
- };
- function get_foo7() {
- return "";
- }
- function set_foo1(value) {}
-}
-function Setter() {
- var _foo = /*#__PURE__*/ new WeakMap(), _foo = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Setter_Field {
- constructor(){
- _class_private_field_init(this, _foo, {
- get: void 0,
- set: set_foo
- });
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- }
- }
- function set_foo(value) {}
- var _foo1 = /*#__PURE__*/ new WeakMap(), _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- class A_Setter_Method {
- constructor(){
- _class_private_field_init(this, _foo1, {
- get: void 0,
- set: set_foo1
- });
- _class_private_method_init(this, _foo1);
- }
- }
- function set_foo1(value) {}
- function foo() {}
- var _foo2 = /*#__PURE__*/ new WeakMap();
- // OK
- class A_Setter_Getter {
- constructor(){
- _class_private_field_init(this, _foo2, {
- get: get_foo,
- set: set_foo2
- });
- }
- }
- function set_foo2(value) {}
- function get_foo() {
- return "";
- }
- var _foo3 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Setter_Setter {
- constructor(){
- _class_private_field_init(this, _foo3, {
- get: void 0,
- set: set_foo3
- });
- }
- }
- function set_foo3(value) {}
- function set_foo3(value) {}
- var _foo4 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Setter_StaticField {
- constructor(){
- _class_private_field_init(this, _foo4, {
- get: void 0,
- set: set_foo4
- });
- }
- }
- var _foo4 = {
- writable: true,
- value: "foo"
- };
- function set_foo4(value) {}
- var _foo5 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Setter_StaticMethod {
- constructor(){
- _class_private_field_init(this, _foo5, {
- get: void 0,
- set: set_foo5
- });
- }
- }
- function set_foo5(value) {}
- function foo1() {}
- var _foo6 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Setter_StaticGetter {
- constructor(){
- _class_private_field_init(this, _foo6, {
- get: void 0,
- set: set_foo6
- });
- }
- }
- var _foo6 = {
- get: get_foo1,
- set: void 0
- };
- function set_foo6(value) {}
- function get_foo1() {
- return "";
- }
- var _foo7 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_Setter_StaticSetter {
- constructor(){
- _class_private_field_init(this, _foo7, {
- get: void 0,
- set: set_foo7
- });
- }
- }
- var _foo7 = {
- get: void 0,
- set: set_foo7
- };
- function set_foo7(value) {}
- function set_foo7(value) {}
-}
-function StaticField() {
- var _foo = /*#__PURE__*/ new WeakMap();
- // Error
- class A_StaticField_Field {
- constructor(){
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- }
- }
- var _foo = {
- writable: true,
- value: "foo"
- };
- var _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- class A_StaticField_Method {
- constructor(){
- _class_private_method_init(this, _foo1);
- }
- }
- var _foo1 = {
- writable: true,
- value: "foo"
- };
- function foo() {}
- var _foo2 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_StaticField_Getter {
- constructor(){
- _class_private_field_init(this, _foo2, {
- get: get_foo,
- set: void 0
- });
- }
- }
- var _foo2 = {
- writable: true,
- value: "foo"
- };
- function get_foo() {
- return "";
- }
- var _foo3 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_StaticField_Setter {
- constructor(){
- _class_private_field_init(this, _foo3, {
- get: void 0,
- set: set_foo
- });
- }
- }
- var _foo3 = {
- writable: true,
- value: "foo"
- };
- function set_foo(value) {}
- // Error
- class A_StaticField_StaticField {
- }
- var _foo4 = {
- writable: true,
- value: "foo"
- };
- var _foo4 = {
- writable: true,
- value: "foo"
- };
- // Error
- class A_StaticField_StaticMethod {
- }
- var _foo5 = {
- writable: true,
- value: "foo"
- };
- function foo1() {}
- // Error
- class A_StaticField_StaticGetter {
- }
- var _foo6 = {
- get: get_foo1,
- set: void 0
- };
- var _foo6 = {
- writable: true,
- value: "foo"
- };
- function get_foo1() {
- return "";
- }
- // Error
- class A_StaticField_StaticSetter {
- }
- var _foo7 = {
- get: void 0,
- set: set_foo1
- };
- var _foo7 = {
- writable: true,
- value: "foo"
- };
- function set_foo1(value) {}
-}
-function StaticMethod() {
- var _foo = /*#__PURE__*/ new WeakMap();
- // Error
- class A_StaticMethod_Field {
- constructor(){
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- }
- }
- function foo() {}
- var _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- class A_StaticMethod_Method {
- constructor(){
- _class_private_method_init(this, _foo1);
- }
- }
- function foo1() {}
- function foo1() {}
- var _foo2 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_StaticMethod_Getter {
- constructor(){
- _class_private_field_init(this, _foo2, {
- get: get_foo,
- set: void 0
- });
- }
- }
- function foo2() {}
- function get_foo() {
- return "";
- }
- var _foo3 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_StaticMethod_Setter {
- constructor(){
- _class_private_field_init(this, _foo3, {
- get: void 0,
- set: set_foo
- });
- }
- }
- function foo3() {}
- function set_foo(value) {}
- // Error
- class A_StaticMethod_StaticField {
- }
- var _foo4 = {
- writable: true,
- value: "foo"
- };
- function foo4() {}
- // Error
- class A_StaticMethod_StaticMethod {
- }
- function foo5() {}
- function foo5() {}
- // Error
- class A_StaticMethod_StaticGetter {
- }
- var _foo5 = {
- get: get_foo1,
- set: void 0
- };
- function foo6() {}
- function get_foo1() {
- return "";
- }
- // Error
- class A_StaticMethod_StaticSetter {
- }
- var _foo6 = {
- get: void 0,
- set: set_foo1
- };
- function foo7() {}
- function set_foo1(value) {}
-}
-function StaticGetter() {
- var _foo = /*#__PURE__*/ new WeakMap();
- // Error
- class A_StaticGetter_Field {
- constructor(){
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- }
- }
- var _foo = {
- get: get_foo,
- set: void 0
- };
- function get_foo() {
- return "";
- }
- var _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- class A_StaticGetter_Method {
- constructor(){
- _class_private_method_init(this, _foo1);
- }
- }
- var _foo1 = {
- get: get_foo1,
- set: void 0
- };
- function get_foo1() {
- return "";
- }
- function foo() {}
- var _foo2 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_StaticGetter_Getter {
- constructor(){
- _class_private_field_init(this, _foo2, {
- get: get_foo2,
- set: void 0
- });
- }
- }
- var _foo2 = {
- get: get_foo2,
- set: void 0
- };
- function get_foo2() {
- return "";
- }
- function get_foo2() {
- return "";
- }
- var _foo3 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_StaticGetter_Setter {
- constructor(){
- _class_private_field_init(this, _foo3, {
- get: void 0,
- set: set_foo
- });
- }
- }
- var _foo3 = {
- get: get_foo3,
- set: void 0
- };
- function get_foo3() {
- return "";
- }
- function set_foo(value) {}
- // Error
- class A_StaticGetter_StaticField {
- }
- var _foo4 = {
- get: get_foo4,
- set: void 0
- };
- function get_foo4() {
- return "";
- }
- function foo1() {}
- // Error
- class A_StaticGetter_StaticMethod {
- }
- var _foo5 = {
- get: get_foo5,
- set: void 0
- };
- function get_foo5() {
- return "";
- }
- function foo2() {}
- // Error
- class A_StaticGetter_StaticGetter {
- }
- var _foo6 = {
- get: get_foo6,
- set: void 0
- };
- function get_foo6() {
- return "";
- }
- function get_foo6() {
- return "";
- }
- // OK
- class A_StaticGetter_StaticSetter {
- }
- var _foo7 = {
- get: get_foo7,
- set: set_foo1
- };
- function get_foo7() {
- return "";
- }
- function set_foo1(value) {}
-}
-function StaticSetter() {
- var _foo = /*#__PURE__*/ new WeakMap();
- // Error
- class A_StaticSetter_Field {
- constructor(){
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- }
- }
- var _foo = {
- get: void 0,
- set: set_foo
- };
- function set_foo(value) {}
- var _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- class A_StaticSetter_Method {
- constructor(){
- _class_private_method_init(this, _foo1);
- }
- }
- var _foo1 = {
- get: void 0,
- set: set_foo1
- };
- function set_foo1(value) {}
- function foo() {}
- var _foo2 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_StaticSetter_Getter {
- constructor(){
- _class_private_field_init(this, _foo2, {
- get: get_foo,
- set: void 0
- });
- }
- }
- var _foo2 = {
- get: void 0,
- set: set_foo2
- };
- function set_foo2(value) {}
- function get_foo() {
- return "";
- }
- var _foo3 = /*#__PURE__*/ new WeakMap();
- // Error
- class A_StaticSetter_Setter {
- constructor(){
- _class_private_field_init(this, _foo3, {
- get: void 0,
- set: set_foo3
- });
- }
- }
- var _foo3 = {
- get: void 0,
- set: set_foo3
- };
- function set_foo3(value) {}
- function set_foo3(value) {}
- // Error
- class A_StaticSetter_StaticField {
- }
- var _foo4 = {
- get: void 0,
- set: set_foo4
- };
- var _foo4 = {
- writable: true,
- value: "foo"
- };
- function set_foo4(value) {}
- // Error
- class A_StaticSetter_StaticMethod {
- }
- var _foo5 = {
- get: void 0,
- set: set_foo5
- };
- function set_foo5(value) {}
- function foo1() {}
- // OK
- class A_StaticSetter_StaticGetter {
- }
- var _foo6 = {
- get: get_foo1,
- set: set_foo6
- };
- function set_foo6(value) {}
- function get_foo1() {
- return "";
- }
- // Error
- class A_StaticSetter_StaticSetter {
- }
- var _foo7 = {
- get: void 0,
- set: set_foo7
- };
- function set_foo7(value) {}
- function set_foo7(value) {}
-}
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 9 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 15 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 21 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 27 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 33 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 39 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 45 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 51 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 59 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 65 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 71 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 77 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 83 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 89 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 95 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 101 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 110 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 116 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 122 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 134 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 140 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 146 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 152 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 160 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 166 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 178 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 184 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 190 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 196 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 202 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 210 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 216 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 222 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 228 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 234 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 240 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 246 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 252 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 260 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 266 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 272 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 278 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 284 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 290 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 296 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 302 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 311 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 317 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 323 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 329 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 335 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 341 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 347 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 360 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 366 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 373 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 379 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 385 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 391 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 403 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/privateNameDuplicateField_es2015.2.minified.js b/crates/swc/tests/tsc-references/privateNameDuplicateField_es2015.2.minified.js
index 1286e0fb78fc..f656bd3e63ae 100644
--- a/crates/swc/tests/tsc-references/privateNameDuplicateField_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/privateNameDuplicateField_es2015.2.minified.js
@@ -1,2 +1,360 @@
-import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs";
-import _class_private_method_init from "@swc/helpers/src/_class_private_method_init.mjs";
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 9 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 15 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 21 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 27 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 33 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 39 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 45 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 51 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 59 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 65 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 71 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 77 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 83 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 89 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 95 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 101 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 110 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 116 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 122 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 134 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 140 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 146 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 152 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 160 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 166 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 178 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 184 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 190 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 196 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 202 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 210 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 216 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 222 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 228 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 234 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 240 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 246 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 252 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 260 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 266 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 272 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 278 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 284 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 290 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 296 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 302 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 311 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 317 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 323 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 329 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 335 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 341 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 347 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 360 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 366 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 373 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 379 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 385 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 391 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 403 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/privateNameDuplicateField_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNameDuplicateField_es5.1.normal.js
index 504029bfa938..f656bd3e63ae 100644
--- a/crates/swc/tests/tsc-references/privateNameDuplicateField_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/privateNameDuplicateField_es5.1.normal.js
@@ -1,911 +1,360 @@
-// @strict: true
-// @target: es6
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs";
-import _class_private_method_init from "@swc/helpers/src/_class_private_method_init.mjs";
-function Field() {
- var foo = function foo() {};
- var get_foo = function get_foo() {
- return "";
- };
- var set_foo = function set_foo(value) {};
- var foo1 = function foo1() {};
- var get_foo1 = function get_foo1() {
- return "";
- };
- var set_foo1 = function set_foo1(value) {};
- var _foo = /*#__PURE__*/ new WeakMap(), _foo = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Field_Field = function A_Field_Field() {
- "use strict";
- _class_call_check(this, A_Field_Field);
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- };
- var _foo1 = /*#__PURE__*/ new WeakMap(), _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- var A_Field_Method = function A_Field_Method() {
- "use strict";
- _class_call_check(this, A_Field_Method);
- _class_private_method_init(this, _foo1);
- _class_private_field_init(this, _foo1, {
- writable: true,
- value: "foo"
- });
- };
- var _foo2 = /*#__PURE__*/ new WeakMap(), _foo2 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Field_Getter = function A_Field_Getter() {
- "use strict";
- _class_call_check(this, A_Field_Getter);
- _class_private_field_init(this, _foo2, {
- get: get_foo,
- set: void 0
- });
- _class_private_field_init(this, _foo2, {
- writable: true,
- value: "foo"
- });
- };
- var _foo3 = /*#__PURE__*/ new WeakMap(), _foo3 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Field_Setter = function A_Field_Setter() {
- "use strict";
- _class_call_check(this, A_Field_Setter);
- _class_private_field_init(this, _foo3, {
- get: void 0,
- set: set_foo
- });
- _class_private_field_init(this, _foo3, {
- writable: true,
- value: "foo"
- });
- };
- var _foo4 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Field_StaticField = function A_Field_StaticField() {
- "use strict";
- _class_call_check(this, A_Field_StaticField);
- _class_private_field_init(this, _foo4, {
- writable: true,
- value: "foo"
- });
- };
- var _foo4 = {
- writable: true,
- value: "foo"
- };
- var _foo5 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Field_StaticMethod = function A_Field_StaticMethod() {
- "use strict";
- _class_call_check(this, A_Field_StaticMethod);
- _class_private_field_init(this, _foo5, {
- writable: true,
- value: "foo"
- });
- };
- var _foo6 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Field_StaticGetter = function A_Field_StaticGetter() {
- "use strict";
- _class_call_check(this, A_Field_StaticGetter);
- _class_private_field_init(this, _foo6, {
- writable: true,
- value: "foo"
- });
- };
- var _foo6 = {
- get: get_foo1,
- set: void 0
- };
- var _foo7 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Field_StaticSetter = function A_Field_StaticSetter() {
- "use strict";
- _class_call_check(this, A_Field_StaticSetter);
- _class_private_field_init(this, _foo7, {
- writable: true,
- value: "foo"
- });
- };
- var _foo7 = {
- get: void 0,
- set: set_foo1
- };
-}
-function Method() {
- var foo = function foo() {};
- var foo1 = function foo1() {};
- var foo1 = function foo1() {};
- var foo2 = function foo2() {};
- var get_foo = function get_foo() {
- return "";
- };
- var foo3 = function foo3() {};
- var set_foo = function set_foo(value) {};
- var foo4 = function foo4() {};
- var foo5 = function foo5() {};
- var foo5 = function foo5() {};
- var foo6 = function foo6() {};
- var get_foo1 = function get_foo1() {
- return "";
- };
- var foo7 = function foo7() {};
- var set_foo1 = function set_foo1(value) {};
- var _foo = /*#__PURE__*/ new WeakSet(), _foo = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Method_Field = function A_Method_Field() {
- "use strict";
- _class_call_check(this, A_Method_Field);
- _class_private_method_init(this, _foo);
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- };
- var _foo1 = /*#__PURE__*/ new WeakSet(), _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- var A_Method_Method = function A_Method_Method() {
- "use strict";
- _class_call_check(this, A_Method_Method);
- _class_private_method_init(this, _foo1);
- _class_private_method_init(this, _foo1);
- };
- var _foo2 = /*#__PURE__*/ new WeakSet(), _foo2 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Method_Getter = function A_Method_Getter() {
- "use strict";
- _class_call_check(this, A_Method_Getter);
- _class_private_method_init(this, _foo2);
- _class_private_field_init(this, _foo2, {
- get: get_foo,
- set: void 0
- });
- };
- var _foo3 = /*#__PURE__*/ new WeakSet(), _foo3 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Method_Setter = function A_Method_Setter() {
- "use strict";
- _class_call_check(this, A_Method_Setter);
- _class_private_method_init(this, _foo3);
- _class_private_field_init(this, _foo3, {
- get: void 0,
- set: set_foo
- });
- };
- var _foo4 = /*#__PURE__*/ new WeakSet();
- // Error
- var A_Method_StaticField = function A_Method_StaticField() {
- "use strict";
- _class_call_check(this, A_Method_StaticField);
- _class_private_method_init(this, _foo4);
- };
- var _foo4 = {
- writable: true,
- value: "foo"
- };
- var _foo5 = /*#__PURE__*/ new WeakSet();
- // Error
- var A_Method_StaticMethod = function A_Method_StaticMethod() {
- "use strict";
- _class_call_check(this, A_Method_StaticMethod);
- _class_private_method_init(this, _foo5);
- };
- var _foo6 = /*#__PURE__*/ new WeakSet();
- // Error
- var A_Method_StaticGetter = function A_Method_StaticGetter() {
- "use strict";
- _class_call_check(this, A_Method_StaticGetter);
- _class_private_method_init(this, _foo6);
- };
- var _foo6 = {
- get: get_foo1,
- set: void 0
- };
- var _foo7 = /*#__PURE__*/ new WeakSet();
- // Error
- var A_Method_StaticSetter = function A_Method_StaticSetter() {
- "use strict";
- _class_call_check(this, A_Method_StaticSetter);
- _class_private_method_init(this, _foo7);
- };
- var _foo7 = {
- get: void 0,
- set: set_foo1
- };
-}
-function Getter() {
- var get_foo = function get_foo() {
- return "";
- };
- var get_foo1 = function get_foo1() {
- return "";
- };
- var foo = function foo() {};
- var get_foo2 = function get_foo2() {
- return "";
- };
- var get_foo2 = function get_foo2() {
- return "";
- };
- var get_foo3 = function get_foo3() {
- return "";
- };
- var set_foo = function set_foo(value) {};
- var get_foo4 = function get_foo4() {
- return "";
- };
- var foo1 = function foo1() {};
- var get_foo5 = function get_foo5() {
- return "";
- };
- var foo2 = function foo2() {};
- var get_foo6 = function get_foo6() {
- return "";
- };
- var get_foo6 = function get_foo6() {
- return "";
- };
- var get_foo7 = function get_foo7() {
- return "";
- };
- var set_foo1 = function set_foo1(value) {};
- var _foo = /*#__PURE__*/ new WeakMap(), _foo = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Getter_Field = function A_Getter_Field() {
- "use strict";
- _class_call_check(this, A_Getter_Field);
- _class_private_field_init(this, _foo, {
- get: get_foo,
- set: void 0
- });
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- };
- var _foo1 = /*#__PURE__*/ new WeakMap(), _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- var A_Getter_Method = function A_Getter_Method() {
- "use strict";
- _class_call_check(this, A_Getter_Method);
- _class_private_field_init(this, _foo1, {
- get: get_foo1,
- set: void 0
- });
- _class_private_method_init(this, _foo1);
- };
- var _foo2 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Getter_Getter = function A_Getter_Getter() {
- "use strict";
- _class_call_check(this, A_Getter_Getter);
- _class_private_field_init(this, _foo2, {
- get: get_foo2,
- set: void 0
- });
- };
- var _foo3 = /*#__PURE__*/ new WeakMap();
- //OK
- var A_Getter_Setter = function A_Getter_Setter() {
- "use strict";
- _class_call_check(this, A_Getter_Setter);
- _class_private_field_init(this, _foo3, {
- get: get_foo3,
- set: set_foo
- });
- };
- var _foo4 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Getter_StaticField = function A_Getter_StaticField() {
- "use strict";
- _class_call_check(this, A_Getter_StaticField);
- _class_private_field_init(this, _foo4, {
- get: get_foo4,
- set: void 0
- });
- };
- var _foo5 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Getter_StaticMethod = function A_Getter_StaticMethod() {
- "use strict";
- _class_call_check(this, A_Getter_StaticMethod);
- _class_private_field_init(this, _foo5, {
- get: get_foo5,
- set: void 0
- });
- };
- var _foo6 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Getter_StaticGetter = function A_Getter_StaticGetter() {
- "use strict";
- _class_call_check(this, A_Getter_StaticGetter);
- _class_private_field_init(this, _foo6, {
- get: get_foo6,
- set: void 0
- });
- };
- var _foo6 = {
- get: get_foo6,
- set: void 0
- };
- var _foo7 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Getter_StaticSetter = function A_Getter_StaticSetter() {
- "use strict";
- _class_call_check(this, A_Getter_StaticSetter);
- _class_private_field_init(this, _foo7, {
- get: get_foo7,
- set: void 0
- });
- };
- var _foo7 = {
- get: void 0,
- set: set_foo1
- };
-}
-function Setter() {
- var set_foo = function set_foo(value) {};
- var set_foo1 = function set_foo1(value) {};
- var foo = function foo() {};
- var set_foo2 = function set_foo2(value) {};
- var get_foo = function get_foo() {
- return "";
- };
- var set_foo3 = function set_foo3(value) {};
- var set_foo3 = function set_foo3(value) {};
- var set_foo4 = function set_foo4(value) {};
- var set_foo5 = function set_foo5(value) {};
- var foo1 = function foo1() {};
- var set_foo6 = function set_foo6(value) {};
- var get_foo1 = function get_foo1() {
- return "";
- };
- var set_foo7 = function set_foo7(value) {};
- var set_foo7 = function set_foo7(value) {};
- var _foo = /*#__PURE__*/ new WeakMap(), _foo = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Setter_Field = function A_Setter_Field() {
- "use strict";
- _class_call_check(this, A_Setter_Field);
- _class_private_field_init(this, _foo, {
- get: void 0,
- set: set_foo
- });
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- };
- var _foo1 = /*#__PURE__*/ new WeakMap(), _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- var A_Setter_Method = function A_Setter_Method() {
- "use strict";
- _class_call_check(this, A_Setter_Method);
- _class_private_field_init(this, _foo1, {
- get: void 0,
- set: set_foo1
- });
- _class_private_method_init(this, _foo1);
- };
- var _foo2 = /*#__PURE__*/ new WeakMap();
- // OK
- var A_Setter_Getter = function A_Setter_Getter() {
- "use strict";
- _class_call_check(this, A_Setter_Getter);
- _class_private_field_init(this, _foo2, {
- get: get_foo,
- set: set_foo2
- });
- };
- var _foo3 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Setter_Setter = function A_Setter_Setter() {
- "use strict";
- _class_call_check(this, A_Setter_Setter);
- _class_private_field_init(this, _foo3, {
- get: void 0,
- set: set_foo3
- });
- };
- var _foo4 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Setter_StaticField = function A_Setter_StaticField() {
- "use strict";
- _class_call_check(this, A_Setter_StaticField);
- _class_private_field_init(this, _foo4, {
- get: void 0,
- set: set_foo4
- });
- };
- var _foo4 = {
- writable: true,
- value: "foo"
- };
- var _foo5 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Setter_StaticMethod = function A_Setter_StaticMethod() {
- "use strict";
- _class_call_check(this, A_Setter_StaticMethod);
- _class_private_field_init(this, _foo5, {
- get: void 0,
- set: set_foo5
- });
- };
- var _foo6 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Setter_StaticGetter = function A_Setter_StaticGetter() {
- "use strict";
- _class_call_check(this, A_Setter_StaticGetter);
- _class_private_field_init(this, _foo6, {
- get: void 0,
- set: set_foo6
- });
- };
- var _foo6 = {
- get: get_foo1,
- set: void 0
- };
- var _foo7 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_Setter_StaticSetter = function A_Setter_StaticSetter() {
- "use strict";
- _class_call_check(this, A_Setter_StaticSetter);
- _class_private_field_init(this, _foo7, {
- get: void 0,
- set: set_foo7
- });
- };
- var _foo7 = {
- get: void 0,
- set: set_foo7
- };
-}
-function StaticField() {
- var foo = function foo() {};
- var get_foo = function get_foo() {
- return "";
- };
- var set_foo = function set_foo(value) {};
- var foo1 = function foo1() {};
- var get_foo1 = function get_foo1() {
- return "";
- };
- var set_foo1 = function set_foo1(value) {};
- var _foo = /*#__PURE__*/ new WeakMap();
- // Error
- var A_StaticField_Field = function A_StaticField_Field() {
- "use strict";
- _class_call_check(this, A_StaticField_Field);
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- };
- var _foo = {
- writable: true,
- value: "foo"
- };
- var _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- var A_StaticField_Method = function A_StaticField_Method() {
- "use strict";
- _class_call_check(this, A_StaticField_Method);
- _class_private_method_init(this, _foo1);
- };
- var _foo1 = {
- writable: true,
- value: "foo"
- };
- var _foo2 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_StaticField_Getter = function A_StaticField_Getter() {
- "use strict";
- _class_call_check(this, A_StaticField_Getter);
- _class_private_field_init(this, _foo2, {
- get: get_foo,
- set: void 0
- });
- };
- var _foo2 = {
- writable: true,
- value: "foo"
- };
- var _foo3 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_StaticField_Setter = function A_StaticField_Setter() {
- "use strict";
- _class_call_check(this, A_StaticField_Setter);
- _class_private_field_init(this, _foo3, {
- get: void 0,
- set: set_foo
- });
- };
- var _foo3 = {
- writable: true,
- value: "foo"
- };
- // Error
- var A_StaticField_StaticField = function A_StaticField_StaticField() {
- "use strict";
- _class_call_check(this, A_StaticField_StaticField);
- };
- var _foo4 = {
- writable: true,
- value: "foo"
- };
- var _foo4 = {
- writable: true,
- value: "foo"
- };
- // Error
- var A_StaticField_StaticMethod = function A_StaticField_StaticMethod() {
- "use strict";
- _class_call_check(this, A_StaticField_StaticMethod);
- };
- var _foo5 = {
- writable: true,
- value: "foo"
- };
- // Error
- var A_StaticField_StaticGetter = function A_StaticField_StaticGetter() {
- "use strict";
- _class_call_check(this, A_StaticField_StaticGetter);
- };
- var _foo6 = {
- get: get_foo1,
- set: void 0
- };
- var _foo6 = {
- writable: true,
- value: "foo"
- };
- // Error
- var A_StaticField_StaticSetter = function A_StaticField_StaticSetter() {
- "use strict";
- _class_call_check(this, A_StaticField_StaticSetter);
- };
- var _foo7 = {
- get: void 0,
- set: set_foo1
- };
- var _foo7 = {
- writable: true,
- value: "foo"
- };
-}
-function StaticMethod() {
- var foo = function foo() {};
- var foo1 = function foo1() {};
- var foo1 = function foo1() {};
- var foo2 = function foo2() {};
- var get_foo = function get_foo() {
- return "";
- };
- var foo3 = function foo3() {};
- var set_foo = function set_foo(value) {};
- var foo4 = function foo4() {};
- var foo5 = function foo5() {};
- var foo5 = function foo5() {};
- var foo6 = function foo6() {};
- var get_foo1 = function get_foo1() {
- return "";
- };
- var foo7 = function foo7() {};
- var set_foo1 = function set_foo1(value) {};
- var _foo = /*#__PURE__*/ new WeakMap();
- // Error
- var A_StaticMethod_Field = function A_StaticMethod_Field() {
- "use strict";
- _class_call_check(this, A_StaticMethod_Field);
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- };
- var _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- var A_StaticMethod_Method = function A_StaticMethod_Method() {
- "use strict";
- _class_call_check(this, A_StaticMethod_Method);
- _class_private_method_init(this, _foo1);
- };
- var _foo2 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_StaticMethod_Getter = function A_StaticMethod_Getter() {
- "use strict";
- _class_call_check(this, A_StaticMethod_Getter);
- _class_private_field_init(this, _foo2, {
- get: get_foo,
- set: void 0
- });
- };
- var _foo3 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_StaticMethod_Setter = function A_StaticMethod_Setter() {
- "use strict";
- _class_call_check(this, A_StaticMethod_Setter);
- _class_private_field_init(this, _foo3, {
- get: void 0,
- set: set_foo
- });
- };
- // Error
- var A_StaticMethod_StaticField = function A_StaticMethod_StaticField() {
- "use strict";
- _class_call_check(this, A_StaticMethod_StaticField);
- };
- var _foo4 = {
- writable: true,
- value: "foo"
- };
- // Error
- var A_StaticMethod_StaticMethod = function A_StaticMethod_StaticMethod() {
- "use strict";
- _class_call_check(this, A_StaticMethod_StaticMethod);
- };
- // Error
- var A_StaticMethod_StaticGetter = function A_StaticMethod_StaticGetter() {
- "use strict";
- _class_call_check(this, A_StaticMethod_StaticGetter);
- };
- var _foo5 = {
- get: get_foo1,
- set: void 0
- };
- // Error
- var A_StaticMethod_StaticSetter = function A_StaticMethod_StaticSetter() {
- "use strict";
- _class_call_check(this, A_StaticMethod_StaticSetter);
- };
- var _foo6 = {
- get: void 0,
- set: set_foo1
- };
-}
-function StaticGetter() {
- var get_foo = function get_foo() {
- return "";
- };
- var get_foo1 = function get_foo1() {
- return "";
- };
- var foo = function foo() {};
- var get_foo2 = function get_foo2() {
- return "";
- };
- var get_foo2 = function get_foo2() {
- return "";
- };
- var get_foo3 = function get_foo3() {
- return "";
- };
- var set_foo = function set_foo(value) {};
- var get_foo4 = function get_foo4() {
- return "";
- };
- var foo1 = function foo1() {};
- var get_foo5 = function get_foo5() {
- return "";
- };
- var foo2 = function foo2() {};
- var get_foo6 = function get_foo6() {
- return "";
- };
- var get_foo6 = function get_foo6() {
- return "";
- };
- var get_foo7 = function get_foo7() {
- return "";
- };
- var set_foo1 = function set_foo1(value) {};
- var _foo = /*#__PURE__*/ new WeakMap();
- // Error
- var A_StaticGetter_Field = function A_StaticGetter_Field() {
- "use strict";
- _class_call_check(this, A_StaticGetter_Field);
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- };
- var _foo = {
- get: get_foo,
- set: void 0
- };
- var _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- var A_StaticGetter_Method = function A_StaticGetter_Method() {
- "use strict";
- _class_call_check(this, A_StaticGetter_Method);
- _class_private_method_init(this, _foo1);
- };
- var _foo1 = {
- get: get_foo1,
- set: void 0
- };
- var _foo2 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_StaticGetter_Getter = function A_StaticGetter_Getter() {
- "use strict";
- _class_call_check(this, A_StaticGetter_Getter);
- _class_private_field_init(this, _foo2, {
- get: get_foo2,
- set: void 0
- });
- };
- var _foo2 = {
- get: get_foo2,
- set: void 0
- };
- var _foo3 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_StaticGetter_Setter = function A_StaticGetter_Setter() {
- "use strict";
- _class_call_check(this, A_StaticGetter_Setter);
- _class_private_field_init(this, _foo3, {
- get: void 0,
- set: set_foo
- });
- };
- var _foo3 = {
- get: get_foo3,
- set: void 0
- };
- // Error
- var A_StaticGetter_StaticField = function A_StaticGetter_StaticField() {
- "use strict";
- _class_call_check(this, A_StaticGetter_StaticField);
- };
- var _foo4 = {
- get: get_foo4,
- set: void 0
- };
- // Error
- var A_StaticGetter_StaticMethod = function A_StaticGetter_StaticMethod() {
- "use strict";
- _class_call_check(this, A_StaticGetter_StaticMethod);
- };
- var _foo5 = {
- get: get_foo5,
- set: void 0
- };
- // Error
- var A_StaticGetter_StaticGetter = function A_StaticGetter_StaticGetter() {
- "use strict";
- _class_call_check(this, A_StaticGetter_StaticGetter);
- };
- var _foo6 = {
- get: get_foo6,
- set: void 0
- };
- // OK
- var A_StaticGetter_StaticSetter = function A_StaticGetter_StaticSetter() {
- "use strict";
- _class_call_check(this, A_StaticGetter_StaticSetter);
- };
- var _foo7 = {
- get: get_foo7,
- set: set_foo1
- };
-}
-function StaticSetter() {
- var set_foo = function set_foo(value) {};
- var set_foo1 = function set_foo1(value) {};
- var foo = function foo() {};
- var set_foo2 = function set_foo2(value) {};
- var get_foo = function get_foo() {
- return "";
- };
- var set_foo3 = function set_foo3(value) {};
- var set_foo3 = function set_foo3(value) {};
- var set_foo4 = function set_foo4(value) {};
- var set_foo5 = function set_foo5(value) {};
- var foo1 = function foo1() {};
- var set_foo6 = function set_foo6(value) {};
- var get_foo1 = function get_foo1() {
- return "";
- };
- var set_foo7 = function set_foo7(value) {};
- var set_foo7 = function set_foo7(value) {};
- var _foo = /*#__PURE__*/ new WeakMap();
- // Error
- var A_StaticSetter_Field = function A_StaticSetter_Field() {
- "use strict";
- _class_call_check(this, A_StaticSetter_Field);
- _class_private_field_init(this, _foo, {
- writable: true,
- value: "foo"
- });
- };
- var _foo = {
- get: void 0,
- set: set_foo
- };
- var _foo1 = /*#__PURE__*/ new WeakSet();
- // Error
- var A_StaticSetter_Method = function A_StaticSetter_Method() {
- "use strict";
- _class_call_check(this, A_StaticSetter_Method);
- _class_private_method_init(this, _foo1);
- };
- var _foo1 = {
- get: void 0,
- set: set_foo1
- };
- var _foo2 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_StaticSetter_Getter = function A_StaticSetter_Getter() {
- "use strict";
- _class_call_check(this, A_StaticSetter_Getter);
- _class_private_field_init(this, _foo2, {
- get: get_foo,
- set: void 0
- });
- };
- var _foo2 = {
- get: void 0,
- set: set_foo2
- };
- var _foo3 = /*#__PURE__*/ new WeakMap();
- // Error
- var A_StaticSetter_Setter = function A_StaticSetter_Setter() {
- "use strict";
- _class_call_check(this, A_StaticSetter_Setter);
- _class_private_field_init(this, _foo3, {
- get: void 0,
- set: set_foo3
- });
- };
- var _foo3 = {
- get: void 0,
- set: set_foo3
- };
- // Error
- var A_StaticSetter_StaticField = function A_StaticSetter_StaticField() {
- "use strict";
- _class_call_check(this, A_StaticSetter_StaticField);
- };
- var _foo4 = {
- get: void 0,
- set: set_foo4
- };
- var _foo4 = {
- writable: true,
- value: "foo"
- };
- // Error
- var A_StaticSetter_StaticMethod = function A_StaticSetter_StaticMethod() {
- "use strict";
- _class_call_check(this, A_StaticSetter_StaticMethod);
- };
- var _foo5 = {
- get: void 0,
- set: set_foo5
- };
- // OK
- var A_StaticSetter_StaticGetter = function A_StaticSetter_StaticGetter() {
- "use strict";
- _class_call_check(this, A_StaticSetter_StaticGetter);
- };
- var _foo6 = {
- get: get_foo1,
- set: set_foo6
- };
- // Error
- var A_StaticSetter_StaticSetter = function A_StaticSetter_StaticSetter() {
- "use strict";
- _class_call_check(this, A_StaticSetter_StaticSetter);
- };
- var _foo7 = {
- get: void 0,
- set: set_foo7
- };
-}
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 9 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 15 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 21 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 27 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 33 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 39 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 45 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 51 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 59 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 65 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 71 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 77 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 83 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 89 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 95 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 101 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 110 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 116 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 122 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 134 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 140 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 146 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 152 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 160 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 166 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 178 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 184 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 190 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 196 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 202 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 210 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 216 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 222 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 228 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 234 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 240 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 246 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 252 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 260 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 266 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 272 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 278 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 284 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 290 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 296 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 302 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 311 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 317 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 323 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 329 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 335 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 341 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 347 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 360 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 366 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 373 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 379 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 385 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 391 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 403 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/privateNameDuplicateField_es5.2.minified.js b/crates/swc/tests/tsc-references/privateNameDuplicateField_es5.2.minified.js
index 237b7aec440d..f656bd3e63ae 100644
--- a/crates/swc/tests/tsc-references/privateNameDuplicateField_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/privateNameDuplicateField_es5.2.minified.js
@@ -1,3 +1,360 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs";
-import _class_private_method_init from "@swc/helpers/src/_class_private_method_init.mjs";
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 9 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 15 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 21 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 27 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 33 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 39 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 45 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 51 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 59 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 65 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 71 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 77 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 83 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 89 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 95 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 101 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 110 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 116 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 122 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 134 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 140 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 146 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 152 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 160 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 166 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 178 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 184 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 190 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 196 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 202 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 210 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 216 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 222 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 228 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 234 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 240 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 246 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 252 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 260 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 266 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 272 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 278 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 284 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 290 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 296 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 302 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 311 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 317 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 323 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 329 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 335 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 341 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 347 | static get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 360 | #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 366 | #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 373 | get #foo() { return ""}
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 379 | set #foo(value: string) { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 385 | static #foo = "foo";
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 391 | static #foo() { }
+//! : ^^^
+//! `----
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 403 | static set #foo(value: string) { }
+//! : ^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/privateNameEmitHelpers_es2015.1.normal.js b/crates/swc/tests/tsc-references/privateNameEmitHelpers_es2015.1.normal.js
index 47db35bb23ad..6e5359e9fb89 100644
--- a/crates/swc/tests/tsc-references/privateNameEmitHelpers_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/privateNameEmitHelpers_es2015.1.normal.js
@@ -26,3 +26,6 @@ function b() {
function set_c(v) {
_class_private_field_set(this, _a, _class_private_field_get(this, _a) + v);
}
+// @filename: tslib.d.ts
+// these are pre-TS4.3 versions of emit helpers, which only supported private instance fields
+export { };
diff --git a/crates/swc/tests/tsc-references/privateNameEmitHelpers_es2015.2.minified.js b/crates/swc/tests/tsc-references/privateNameEmitHelpers_es2015.2.minified.js
index 4c15e7021fc4..99db1b5edf9b 100644
--- a/crates/swc/tests/tsc-references/privateNameEmitHelpers_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/privateNameEmitHelpers_es2015.2.minified.js
@@ -16,3 +16,4 @@ export class C {
});
}
}
+export { };
diff --git a/crates/swc/tests/tsc-references/privateNameEmitHelpers_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNameEmitHelpers_es5.1.normal.js
index b652cc200d0e..9c2f54fedbc6 100644
--- a/crates/swc/tests/tsc-references/privateNameEmitHelpers_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/privateNameEmitHelpers_es5.1.normal.js
@@ -27,3 +27,6 @@ function b() {
function set_c(v) {
_class_private_field_set(this, _a, _class_private_field_get(this, _a) + v);
}
+// @filename: tslib.d.ts
+// these are pre-TS4.3 versions of emit helpers, which only supported private instance fields
+export { };
diff --git a/crates/swc/tests/tsc-references/privateNameEmitHelpers_es5.2.minified.js b/crates/swc/tests/tsc-references/privateNameEmitHelpers_es5.2.minified.js
index 70a041317118..8656b25f937e 100644
--- a/crates/swc/tests/tsc-references/privateNameEmitHelpers_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/privateNameEmitHelpers_es5.2.minified.js
@@ -17,3 +17,4 @@ export var C = function() {
function set_c(v) {
_class_private_field_set(this, _a, _class_private_field_get(this, _a) + v);
}
+export { };
diff --git a/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es2015.1.normal.js b/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es2015.1.normal.js
index b301507c82be..768b44aa8a73 100644
--- a/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es2015.1.normal.js
@@ -20,3 +20,6 @@ function b() {
function get_c() {
return _class_static_private_method_get(S, S, b).call(S);
}
+// @filename: tslib.d.ts
+// these are pre-TS4.3 versions of emit helpers, which only supported private instance fields
+export { };
diff --git a/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es2015.2.minified.js b/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es2015.2.minified.js
index 8d3fe9e981f0..1fdcc8e1b2d1 100644
--- a/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es2015.2.minified.js
@@ -2,3 +2,4 @@ import _class_static_private_field_spec_set from "@swc/helpers/src/_class_static
import _class_static_private_method_get from "@swc/helpers/src/_class_static_private_method_get.mjs";
export class S {
}
+export { };
diff --git a/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es5.1.normal.js
index a7cd0848b8ed..abbe0031ae4b 100644
--- a/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es5.1.normal.js
@@ -23,3 +23,6 @@ function b() {
function get_c() {
return _class_static_private_method_get(S, S, b).call(S);
}
+// @filename: tslib.d.ts
+// these are pre-TS4.3 versions of emit helpers, which only supported private instance fields
+export { };
diff --git a/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es5.2.minified.js b/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es5.2.minified.js
index 5184cc60a527..7845c48cec0b 100644
--- a/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/privateNameStaticEmitHelpers_es5.2.minified.js
@@ -5,3 +5,4 @@ export var S = function() {
"use strict";
_class_call_check(this, S);
};
+export { };
diff --git a/crates/swc/tests/tsc-references/privateNamesUnique-2_es2015.1.normal.js b/crates/swc/tests/tsc-references/privateNamesUnique-2_es2015.1.normal.js
index 8664b247f904..df1c373d4721 100644
--- a/crates/swc/tests/tsc-references/privateNamesUnique-2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/privateNamesUnique-2_es2015.1.normal.js
@@ -14,11 +14,12 @@ export class Foo {
});
}
}
-var _x1 = /*#__PURE__*/ new WeakMap();
// @filename: b.ts
+import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs";
+var _x = /*#__PURE__*/ new WeakMap();
export class Foo {
constructor(){
- _class_private_field_init(this, _x1, {
+ _class_private_field_init(this, _x, {
writable: true,
value: void 0
});
diff --git a/crates/swc/tests/tsc-references/privateNamesUnique-2_es2015.2.minified.js b/crates/swc/tests/tsc-references/privateNamesUnique-2_es2015.2.minified.js
index eb1500809474..9972a8425b65 100644
--- a/crates/swc/tests/tsc-references/privateNamesUnique-2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/privateNamesUnique-2_es2015.2.minified.js
@@ -12,10 +12,11 @@ export class Foo {
});
}
}
-var _x1 = new WeakMap();
+import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs";
+var _x = new WeakMap();
export class Foo {
constructor(){
- _class_private_field_init(this, _x1, {
+ _class_private_field_init(this, _x, {
writable: !0,
value: void 0
});
diff --git a/crates/swc/tests/tsc-references/privateNamesUnique-2_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNamesUnique-2_es5.1.normal.js
index 1f46a139a4a4..19d83e884dd0 100644
--- a/crates/swc/tests/tsc-references/privateNamesUnique-2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/privateNamesUnique-2_es5.1.normal.js
@@ -19,12 +19,14 @@ export var Foo = /*#__PURE__*/ function() {
};
return Foo;
}();
-var _x1 = /*#__PURE__*/ new WeakMap();
// @filename: b.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs";
+var _x = /*#__PURE__*/ new WeakMap();
export var Foo = function Foo() {
"use strict";
_class_call_check(this, Foo);
- _class_private_field_init(this, _x1, {
+ _class_private_field_init(this, _x, {
writable: true,
value: void 0
});
diff --git a/crates/swc/tests/tsc-references/privateNamesUnique-2_es5.2.minified.js b/crates/swc/tests/tsc-references/privateNamesUnique-2_es5.2.minified.js
index c4b5f4abf79f..4f6310f57d15 100644
--- a/crates/swc/tests/tsc-references/privateNamesUnique-2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/privateNamesUnique-2_es5.2.minified.js
@@ -14,10 +14,12 @@ export var Foo = function() {
_class_private_field_get(other, _x);
}, Foo;
}();
-var _x1 = new WeakMap();
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs";
+var _x = new WeakMap();
export var Foo = function() {
"use strict";
- _class_call_check(this, Foo), _class_private_field_init(this, _x1, {
+ _class_call_check(this, Foo), _class_private_field_init(this, _x, {
writable: !0,
value: void 0
});
diff --git a/crates/swc/tests/tsc-references/privateNamesUnique-3_es2015.1.normal.js b/crates/swc/tests/tsc-references/privateNamesUnique-3_es2015.1.normal.js
index 02f4a42c25cc..b6ab4f1d4efc 100644
--- a/crates/swc/tests/tsc-references/privateNamesUnique-3_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/privateNamesUnique-3_es2015.1.normal.js
@@ -1,26 +1,6 @@
-// @target: es2015
-import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs";
-import _class_static_private_field_spec_get from "@swc/helpers/src/_class_static_private_field_spec_get.mjs";
-var _foo = /*#__PURE__*/ new WeakMap();
-class A {
- constructor(){
- _class_private_field_init(this, _foo, {
- writable: true,
- value: 1
- });
- }
-}
-var _foo = {
- writable: true,
- value: true
-}// error (duplicate)
-;
-class B {
- test(x) {
- _class_static_private_field_spec_get(x, B, _foo1); // error (#foo is a static property on B, not an instance property)
- }
-}
-var _foo1 = {
- writable: true,
- value: true
-};
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 5 | static #foo = true; // error (duplicate)
+//! : ^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/privateNamesUnique-3_es2015.2.minified.js b/crates/swc/tests/tsc-references/privateNamesUnique-3_es2015.2.minified.js
index 88eb8092624a..b6ab4f1d4efc 100644
--- a/crates/swc/tests/tsc-references/privateNamesUnique-3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/privateNamesUnique-3_es2015.2.minified.js
@@ -1,11 +1,6 @@
-import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs";
-import _class_static_private_field_spec_get from "@swc/helpers/src/_class_static_private_field_spec_get.mjs";
-class B {
- test(x) {
- _class_static_private_field_spec_get(x, B, _foo);
- }
-}
-var _foo = {
- writable: !0,
- value: !0
-};
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 5 | static #foo = true; // error (duplicate)
+//! : ^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/privateNamesUnique-3_es5.1.normal.js b/crates/swc/tests/tsc-references/privateNamesUnique-3_es5.1.normal.js
index 0797ea97acfc..b6ab4f1d4efc 100644
--- a/crates/swc/tests/tsc-references/privateNamesUnique-3_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/privateNamesUnique-3_es5.1.normal.js
@@ -1,33 +1,6 @@
-// @target: es2015
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs";
-import _class_static_private_field_spec_get from "@swc/helpers/src/_class_static_private_field_spec_get.mjs";
-var _foo = /*#__PURE__*/ new WeakMap();
-var A = function A() {
- "use strict";
- _class_call_check(this, A);
- _class_private_field_init(this, _foo, {
- writable: true,
- value: 1
- });
-};
-var _foo = {
- writable: true,
- value: true
-}// error (duplicate)
-;
-var B = /*#__PURE__*/ function() {
- "use strict";
- function B() {
- _class_call_check(this, B);
- }
- var _proto = B.prototype;
- _proto.test = function test(x) {
- _class_static_private_field_spec_get(x, B, _foo1); // error (#foo is a static property on B, not an instance property)
- };
- return B;
-}();
-var _foo1 = {
- writable: true,
- value: true
-};
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 5 | static #foo = true; // error (duplicate)
+//! : ^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/privateNamesUnique-3_es5.2.minified.js b/crates/swc/tests/tsc-references/privateNamesUnique-3_es5.2.minified.js
index aea06fbc82be..b6ab4f1d4efc 100644
--- a/crates/swc/tests/tsc-references/privateNamesUnique-3_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/privateNamesUnique-3_es5.2.minified.js
@@ -1,24 +1,6 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs";
-import _class_static_private_field_spec_get from "@swc/helpers/src/_class_static_private_field_spec_get.mjs";
-var _foo = new WeakMap(), A = function() {
- "use strict";
- _class_call_check(this, A), _class_private_field_init(this, _foo, {
- writable: !0,
- value: 1
- });
-}, _foo = {
- writable: !0,
- value: !0
-}, B = function() {
- "use strict";
- function B() {
- _class_call_check(this, B);
- }
- return B.prototype.test = function(x) {
- _class_static_private_field_spec_get(x, B, _foo1);
- }, B;
-}(), _foo1 = {
- writable: !0,
- value: !0
-};
+//!
+//! x duplicate private name #foo.
+//! ,----
+//! 5 | static #foo = true; // error (duplicate)
+//! : ^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.1.normal.js b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.1.normal.js
index dba399ea5d03..0f0e0b77733c 100644
--- a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.1.normal.js
@@ -3,4 +3,6 @@
// @noEmit: true
// @Filename: mod1.js
export var hurk = {};
+// @Filename: bug24658.js
+import { hurk } from './mod1';
hurk.expando = 4;
diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.2.minified.js b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.2.minified.js
index 57a3cb206578..bc19fd104a02 100644
--- a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es2015.2.minified.js
@@ -1,2 +1,3 @@
export var hurk = {};
+import { hurk } from './mod1';
hurk.expando = 4;
diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.1.normal.js b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.1.normal.js
index dba399ea5d03..b6bf505c516e 100644
--- a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.1.normal.js
@@ -3,4 +3,6 @@
// @noEmit: true
// @Filename: mod1.js
export var hurk = {};
+// @Filename: bug24658.js
+import { hurk } from "./mod1";
hurk.expando = 4;
diff --git a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.2.minified.js b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.2.minified.js
index 57a3cb206578..019956a8220b 100644
--- a/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/propertyAssignmentOnImportedSymbol_es5.2.minified.js
@@ -1,2 +1,3 @@
export var hurk = {};
+import { hurk } from "./mod1";
hurk.expando = 4;
diff --git a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es2015.2.minified.js b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es2015.2.minified.js
index 599b69ed23b2..955e38226124 100644
--- a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es2015.2.minified.js
@@ -1,4 +1,6 @@
-var one, two, Ns = {};
+var Ns = {};
Ns.One = function() {}, Ns.Two = function() {}, Ns.One.prototype = {
ok () {}
-}, Ns.Two.prototype = {}, one.wat, two.wat;
+}, Ns.Two.prototype = {};
+var two;
+(void 0).wat, two.wat;
diff --git a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es5.2.minified.js b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es5.2.minified.js
index e235da296f18..c27f8b162184 100644
--- a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles2_es5.2.minified.js
@@ -1,4 +1,6 @@
-var one, two, Ns = {};
+var Ns = {};
Ns.One = function() {}, Ns.Two = function() {}, Ns.One.prototype = {
ok: function() {}
-}, Ns.Two.prototype = {}, one.wat, two.wat;
+}, Ns.Two.prototype = {};
+var two;
+(void 0).wat, two.wat;
diff --git a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles_es2015.2.minified.js b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles_es2015.2.minified.js
index 2877f0f36c14..55fcff781dde 100644
--- a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles_es2015.2.minified.js
@@ -1,5 +1,3 @@
-(function() {
- this.a = 1;
-}).prototype.foo = function() {
+C.prototype.foo = function() {
return this.a;
};
diff --git a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles_es5.2.minified.js b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles_es5.2.minified.js
index 2877f0f36c14..55fcff781dde 100644
--- a/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/prototypePropertyAssignmentMergeAcrossFiles_es5.2.minified.js
@@ -1,5 +1,3 @@
-(function() {
- this.a = 1;
-}).prototype.foo = function() {
+C.prototype.foo = function() {
return this.a;
};
diff --git a/crates/swc/tests/tsc-references/reExportDefaultExport_es2015.2.minified.js b/crates/swc/tests/tsc-references/reExportDefaultExport_es2015.2.minified.js
index 5965858309be..019e7e1c7da1 100644
--- a/crates/swc/tests/tsc-references/reExportDefaultExport_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/reExportDefaultExport_es2015.2.minified.js
@@ -1,5 +1,5 @@
export default function f() {};
+export { f };
import foo from "./m1";
import { f } from "./m1";
f(), foo();
-export { f };
diff --git a/crates/swc/tests/tsc-references/reExportDefaultExport_es5.2.minified.js b/crates/swc/tests/tsc-references/reExportDefaultExport_es5.2.minified.js
index 5965858309be..019e7e1c7da1 100644
--- a/crates/swc/tests/tsc-references/reExportDefaultExport_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/reExportDefaultExport_es5.2.minified.js
@@ -1,5 +1,5 @@
export default function f() {};
+export { f };
import foo from "./m1";
import { f } from "./m1";
f(), foo();
-export { f };
diff --git a/crates/swc/tests/tsc-references/readonlyInAmbientClass_es2015.1.normal.js b/crates/swc/tests/tsc-references/readonlyInAmbientClass_es2015.1.normal.js
new file mode 100644
index 000000000000..edec5c16d2bb
--- /dev/null
+++ b/crates/swc/tests/tsc-references/readonlyInAmbientClass_es2015.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(readonly x: number);
+//! : ^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | method(readonly x: number);
+//! : ^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/readonlyInAmbientClass_es2015.2.minified.js b/crates/swc/tests/tsc-references/readonlyInAmbientClass_es2015.2.minified.js
new file mode 100644
index 000000000000..edec5c16d2bb
--- /dev/null
+++ b/crates/swc/tests/tsc-references/readonlyInAmbientClass_es2015.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(readonly x: number);
+//! : ^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | method(readonly x: number);
+//! : ^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/readonlyInAmbientClass_es5.1.normal.js b/crates/swc/tests/tsc-references/readonlyInAmbientClass_es5.1.normal.js
new file mode 100644
index 000000000000..edec5c16d2bb
--- /dev/null
+++ b/crates/swc/tests/tsc-references/readonlyInAmbientClass_es5.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(readonly x: number);
+//! : ^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | method(readonly x: number);
+//! : ^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/readonlyInAmbientClass_es5.2.minified.js b/crates/swc/tests/tsc-references/readonlyInAmbientClass_es5.2.minified.js
new file mode 100644
index 000000000000..edec5c16d2bb
--- /dev/null
+++ b/crates/swc/tests/tsc-references/readonlyInAmbientClass_es5.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 2 | constructor(readonly x: number);
+//! : ^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x A parameter property is only allowed in a constructor implementation
+//! ,----
+//! 3 | method(readonly x: number);
+//! : ^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/reexportClassDefinition_es2015.1.normal.js b/crates/swc/tests/tsc-references/reexportClassDefinition_es2015.1.normal.js
index d2bcaa4ba909..bf516acc1103 100644
--- a/crates/swc/tests/tsc-references/reexportClassDefinition_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/reexportClassDefinition_es2015.1.normal.js
@@ -2,11 +2,16 @@
// @Filename: foo1.ts
class x {
}
+module.exports = x;
+export { };
// @Filename: foo2.ts
const foo1 = require('./foo1');
+module.exports = {
+ x: foo1
+};
+export { };
// @Filename: foo3.ts
const foo2 = require('./foo2');
class x extends foo2.x {
}
-module.exports = x;
export { };
diff --git a/crates/swc/tests/tsc-references/reexportClassDefinition_es2015.2.minified.js b/crates/swc/tests/tsc-references/reexportClassDefinition_es2015.2.minified.js
index 229100316c86..3c0befcf023a 100644
--- a/crates/swc/tests/tsc-references/reexportClassDefinition_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/reexportClassDefinition_es2015.2.minified.js
@@ -1,8 +1,12 @@
-class x {
-}
-require('./foo1');
+module.exports = class {
+};
+export { };
+let foo1 = require('./foo1');
+module.exports = {
+ x: foo1
+};
+export { };
let foo2 = require('./foo2');
class x extends foo2.x {
}
-module.exports = x;
export { };
diff --git a/crates/swc/tests/tsc-references/reexportClassDefinition_es5.1.normal.js b/crates/swc/tests/tsc-references/reexportClassDefinition_es5.1.normal.js
index f79ec7413479..037150892623 100644
--- a/crates/swc/tests/tsc-references/reexportClassDefinition_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/reexportClassDefinition_es5.1.normal.js
@@ -1,15 +1,22 @@
// @module: commonjs
// @Filename: foo1.ts
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
var x = function x() {
"use strict";
_class_call_check(this, x);
};
+module.exports = x;
+export { };
// @Filename: foo2.ts
var foo1 = require("./foo1");
+module.exports = {
+ x: foo1
+};
+export { };
// @Filename: foo3.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var foo2 = require("./foo2");
var x = /*#__PURE__*/ function(_x) {
"use strict";
@@ -21,5 +28,4 @@ var x = /*#__PURE__*/ function(_x) {
}
return x;
}(foo2.x);
-module.exports = x;
export { };
diff --git a/crates/swc/tests/tsc-references/reexportClassDefinition_es5.2.minified.js b/crates/swc/tests/tsc-references/reexportClassDefinition_es5.2.minified.js
index d64d4fc33092..314eb7fca673 100644
--- a/crates/swc/tests/tsc-references/reexportClassDefinition_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/reexportClassDefinition_es5.2.minified.js
@@ -1,11 +1,17 @@
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
var x = function() {
"use strict";
_class_call_check(this, x);
};
-require("./foo1");
+module.exports = x;
+var foo1 = require("./foo1");
+module.exports = {
+ x: foo1
+};
+export { };
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var x = function(_x) {
"use strict";
_inherits(x, _x);
@@ -15,4 +21,3 @@ var x = function(_x) {
}
return x;
}(require("./foo2").x);
-module.exports = x;
diff --git a/crates/swc/tests/tsc-references/relativePathMustResolve_es2015.1.normal.js b/crates/swc/tests/tsc-references/relativePathMustResolve_es2015.1.normal.js
index 9164106117cf..baac536d440a 100644
--- a/crates/swc/tests/tsc-references/relativePathMustResolve_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/relativePathMustResolve_es2015.1.normal.js
@@ -4,3 +4,4 @@ export var x = 42;
// @Filename: foo_1.ts
const foo = require('./test/foo');
var z = foo.x + 10;
+export { };
diff --git a/crates/swc/tests/tsc-references/relativePathMustResolve_es2015.2.minified.js b/crates/swc/tests/tsc-references/relativePathMustResolve_es2015.2.minified.js
index ceaf39816647..b4ffee0eec6b 100644
--- a/crates/swc/tests/tsc-references/relativePathMustResolve_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/relativePathMustResolve_es2015.2.minified.js
@@ -1,3 +1,4 @@
export var x = 42;
let foo = require('./test/foo');
foo.x;
+export { };
diff --git a/crates/swc/tests/tsc-references/relativePathMustResolve_es5.1.normal.js b/crates/swc/tests/tsc-references/relativePathMustResolve_es5.1.normal.js
index 07249a718d9d..7297d85e7953 100644
--- a/crates/swc/tests/tsc-references/relativePathMustResolve_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/relativePathMustResolve_es5.1.normal.js
@@ -4,3 +4,4 @@ export var x = 42;
// @Filename: foo_1.ts
var foo = require("./test/foo");
var z = foo.x + 10;
+export { };
diff --git a/crates/swc/tests/tsc-references/relativePathMustResolve_es5.2.minified.js b/crates/swc/tests/tsc-references/relativePathMustResolve_es5.2.minified.js
index 75669317f557..622411847236 100644
--- a/crates/swc/tests/tsc-references/relativePathMustResolve_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/relativePathMustResolve_es5.2.minified.js
@@ -1,2 +1,3 @@
export var x = 42;
require("./test/foo").x;
+export { };
diff --git a/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es2015.1.normal.js b/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es2015.1.normal.js
index 4544552e9f10..4a2fcd19c1ce 100644
--- a/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es2015.1.normal.js
@@ -1,5 +1,11 @@
// @ModuleResolution: classic
// @Filename: test/foo.d.ts
+export { };
+// @Filename: test/other.d.ts
+export { };
+// @Filename: test/sub/relMod.d.ts
+module.exports = Test;
+export { };
// @Filename: test/file1.ts
const foo = require('foo');
const other = require('./other');
@@ -7,5 +13,4 @@ const relMod = require('./sub/relMod');
if (foo.M2.x) {
var x = new relMod(other.M2.x.charCodeAt(0));
}
-module.exports = Test;
export { };
diff --git a/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es2015.2.minified.js b/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es2015.2.minified.js
index 0642445eee86..90183c9a844c 100644
--- a/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es2015.2.minified.js
@@ -1,3 +1,7 @@
+export { };
+export { };
+module.exports = Test;
+export { };
let foo = require('foo'), other = require('./other'), relMod = require('./sub/relMod');
-foo.M2.x && new relMod(other.M2.x.charCodeAt(0)), module.exports = Test;
+foo.M2.x && new relMod(other.M2.x.charCodeAt(0));
export { };
diff --git a/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es5.1.normal.js b/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es5.1.normal.js
index 569f90c9a6ad..0ac0b0d19b63 100644
--- a/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es5.1.normal.js
@@ -1,5 +1,11 @@
// @ModuleResolution: classic
// @Filename: test/foo.d.ts
+export { };
+// @Filename: test/other.d.ts
+export { };
+// @Filename: test/sub/relMod.d.ts
+module.exports = Test;
+export { };
// @Filename: test/file1.ts
var foo = require("foo");
var other = require("./other");
@@ -7,5 +13,4 @@ var relMod = require("./sub/relMod");
if (foo.M2.x) {
var x = new relMod(other.M2.x.charCodeAt(0));
}
-module.exports = Test;
export { };
diff --git a/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es5.2.minified.js b/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es5.2.minified.js
index 235e27405d8c..fc715129fffe 100644
--- a/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/relativePathToDeclarationFile_es5.2.minified.js
@@ -1,3 +1,7 @@
+export { };
+export { };
+module.exports = Test;
+export { };
var foo = require("foo"), other = require("./other"), relMod = require("./sub/relMod");
-foo.M2.x && new relMod(other.M2.x.charCodeAt(0)), module.exports = Test;
+foo.M2.x && new relMod(other.M2.x.charCodeAt(0));
export { };
diff --git a/crates/swc/tests/tsc-references/renamed_es2015.1.normal.js b/crates/swc/tests/tsc-references/renamed_es2015.1.normal.js
index d8e1708a3286..f446d0d7f375 100644
--- a/crates/swc/tests/tsc-references/renamed_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/renamed_es2015.1.normal.js
@@ -2,5 +2,9 @@
// @Filename: /a.ts
class A {
}
+export { };
+// @Filename: /b.ts
+export { };
+// @Filename: /c.ts
const d = {};
export { };
diff --git a/crates/swc/tests/tsc-references/renamed_es2015.2.minified.js b/crates/swc/tests/tsc-references/renamed_es2015.2.minified.js
index 2234b9cae16d..f109f4c5600e 100644
--- a/crates/swc/tests/tsc-references/renamed_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/renamed_es2015.2.minified.js
@@ -1 +1,3 @@
export { };
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/renamed_es5.1.normal.js b/crates/swc/tests/tsc-references/renamed_es5.1.normal.js
index 7099ae234205..22fa879f7a1a 100644
--- a/crates/swc/tests/tsc-references/renamed_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/renamed_es5.1.normal.js
@@ -5,5 +5,9 @@ var A = function A() {
"use strict";
_class_call_check(this, A);
};
+export { };
+// @Filename: /b.ts
+export { };
+// @Filename: /c.ts
var d = {};
export { };
diff --git a/crates/swc/tests/tsc-references/renamed_es5.2.minified.js b/crates/swc/tests/tsc-references/renamed_es5.2.minified.js
index 592a79d4705e..185814c32146 100644
--- a/crates/swc/tests/tsc-references/renamed_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/renamed_es5.2.minified.js
@@ -3,3 +3,5 @@ var A = function() {
"use strict";
_class_call_check(this, A);
};
+export { };
+export { };
diff --git a/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es2015.2.minified.js b/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es2015.2.minified.js
index 9bc4643a77ff..3313c4ee273f 100644
--- a/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/requireOfESWithPropertyAccess_es2015.2.minified.js
@@ -1,4 +1,4 @@
-let x = require('./ch').x;
+const x = require('./ch').x;
x.grey, x.x.grey;
let x = {
grey: {}
diff --git a/crates/swc/tests/tsc-references/restElementMustBeLast_es2015.1.normal.js b/crates/swc/tests/tsc-references/restElementMustBeLast_es2015.1.normal.js
new file mode 100644
index 000000000000..6a5f304fc3d0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/restElementMustBeLast_es2015.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x Rest element must be final element
+//! ,----
+//! 1 | var [...a, x] = [1, 2, 3]; // Error, rest must be last element
+//! : ^^^^
+//! `----
+//!
+//! x Rest element must be final element
+//! ,----
+//! 2 | [...a, x] = [1, 2, 3]; // Error, rest must be last element
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/restElementMustBeLast_es2015.2.minified.js b/crates/swc/tests/tsc-references/restElementMustBeLast_es2015.2.minified.js
new file mode 100644
index 000000000000..6a5f304fc3d0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/restElementMustBeLast_es2015.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x Rest element must be final element
+//! ,----
+//! 1 | var [...a, x] = [1, 2, 3]; // Error, rest must be last element
+//! : ^^^^
+//! `----
+//!
+//! x Rest element must be final element
+//! ,----
+//! 2 | [...a, x] = [1, 2, 3]; // Error, rest must be last element
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/restElementMustBeLast_es5.1.normal.js b/crates/swc/tests/tsc-references/restElementMustBeLast_es5.1.normal.js
new file mode 100644
index 000000000000..6a5f304fc3d0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/restElementMustBeLast_es5.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x Rest element must be final element
+//! ,----
+//! 1 | var [...a, x] = [1, 2, 3]; // Error, rest must be last element
+//! : ^^^^
+//! `----
+//!
+//! x Rest element must be final element
+//! ,----
+//! 2 | [...a, x] = [1, 2, 3]; // Error, rest must be last element
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/restElementMustBeLast_es5.2.minified.js b/crates/swc/tests/tsc-references/restElementMustBeLast_es5.2.minified.js
new file mode 100644
index 000000000000..6a5f304fc3d0
--- /dev/null
+++ b/crates/swc/tests/tsc-references/restElementMustBeLast_es5.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x Rest element must be final element
+//! ,----
+//! 1 | var [...a, x] = [1, 2, 3]; // Error, rest must be last element
+//! : ^^^^
+//! `----
+//!
+//! x Rest element must be final element
+//! ,----
+//! 2 | [...a, x] = [1, 2, 3]; // Error, rest must be last element
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/scopedPackagesClassic_es2015.1.normal.js b/crates/swc/tests/tsc-references/scopedPackagesClassic_es2015.1.normal.js
index 650dfdc5443d..a0cda555c68b 100644
--- a/crates/swc/tests/tsc-references/scopedPackagesClassic_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/scopedPackagesClassic_es2015.1.normal.js
@@ -4,3 +4,5 @@
// @moduleResolution: classic
// @filename: /node_modules/@types/see__saw/index.d.ts
export const x = 0;
+// @filename: /a.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/scopedPackagesClassic_es2015.2.minified.js b/crates/swc/tests/tsc-references/scopedPackagesClassic_es2015.2.minified.js
index 297819228b8c..4eb92e6cc3b9 100644
--- a/crates/swc/tests/tsc-references/scopedPackagesClassic_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/scopedPackagesClassic_es2015.2.minified.js
@@ -1 +1,2 @@
export const x = 0;
+export { };
diff --git a/crates/swc/tests/tsc-references/scopedPackagesClassic_es5.1.normal.js b/crates/swc/tests/tsc-references/scopedPackagesClassic_es5.1.normal.js
index b18a88adb77d..d6a4a16fea8d 100644
--- a/crates/swc/tests/tsc-references/scopedPackagesClassic_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/scopedPackagesClassic_es5.1.normal.js
@@ -4,3 +4,5 @@
// @moduleResolution: classic
// @filename: /node_modules/@types/see__saw/index.d.ts
export var x = 0;
+// @filename: /a.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/scopedPackagesClassic_es5.2.minified.js b/crates/swc/tests/tsc-references/scopedPackagesClassic_es5.2.minified.js
index db41b54f1a85..3356f013df63 100644
--- a/crates/swc/tests/tsc-references/scopedPackagesClassic_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/scopedPackagesClassic_es5.2.minified.js
@@ -1 +1,2 @@
export var x = 0;
+export { };
diff --git a/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.1.normal.js
index cd79b25e0852..3b8c040a962b 100644
--- a/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.1.normal.js
@@ -1,25 +1,11 @@
-// all errors imported modules conflict with local variables
-var A;
-(function(A) {
- var Point = A.Point = {
- x: 0,
- y: 0
- };
-})(A || (A = {}));
-var B;
-(function(B) {
- var A = {
- x: 0,
- y: 0
- };
-})(B || (B = {}));
-var X;
-(function(X) {
- class Y {
- }
- X.Y = Y;
-})(X || (X = {}));
-var Z;
-(function(Z) {
- var Y = 12;
-})(Z || (Z = {}));
+//!
+//! x the name `Y` is defined multiple times
+//! ,-[30:5]
+//! 30 | import Y = X.Y;
+//! : |
+//! : `-- previous definition of `Y` here
+//! 31 |
+//! 32 | var Y = 12;
+//! : |
+//! : `-- `Y` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.2.minified.js
index 58aa7fdc12a8..3b8c040a962b 100644
--- a/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/shadowedInternalModule_es2015.2.minified.js
@@ -1,6 +1,11 @@
-var A, B, X, Z;
-(A || (A = {})).Point = {
- x: 0,
- y: 0
-}, B || (B = {}), (X || (X = {})).Y = class {
-}, Z || (Z = {});
+//!
+//! x the name `Y` is defined multiple times
+//! ,-[30:5]
+//! 30 | import Y = X.Y;
+//! : |
+//! : `-- previous definition of `Y` here
+//! 31 |
+//! 32 | var Y = 12;
+//! : |
+//! : `-- `Y` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/shadowedInternalModule_es5.1.normal.js b/crates/swc/tests/tsc-references/shadowedInternalModule_es5.1.normal.js
index 8f3da8674c64..3b8c040a962b 100644
--- a/crates/swc/tests/tsc-references/shadowedInternalModule_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/shadowedInternalModule_es5.1.normal.js
@@ -1,28 +1,11 @@
-// all errors imported modules conflict with local variables
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var A;
-(function(A) {
- var Point = A.Point = {
- x: 0,
- y: 0
- };
-})(A || (A = {}));
-var B;
-(function(B) {
- var A = {
- x: 0,
- y: 0
- };
-})(B || (B = {}));
-var X;
-(function(X) {
- var Y = function Y() {
- "use strict";
- _class_call_check(this, Y);
- };
- X.Y = Y;
-})(X || (X = {}));
-var Z;
-(function(Z) {
- var Y = 12;
-})(Z || (Z = {}));
+//!
+//! x the name `Y` is defined multiple times
+//! ,-[30:5]
+//! 30 | import Y = X.Y;
+//! : |
+//! : `-- previous definition of `Y` here
+//! 31 |
+//! 32 | var Y = 12;
+//! : |
+//! : `-- `Y` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/shadowedInternalModule_es5.2.minified.js b/crates/swc/tests/tsc-references/shadowedInternalModule_es5.2.minified.js
index d3be30603932..3b8c040a962b 100644
--- a/crates/swc/tests/tsc-references/shadowedInternalModule_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/shadowedInternalModule_es5.2.minified.js
@@ -1,12 +1,11 @@
-var A, B, X, Z;
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-(A || (A = {})).Point = {
- x: 0,
- y: 0
-}, B || (B = {}), function(X) {
- var Y = function() {
- "use strict";
- _class_call_check(this, Y);
- };
- X.Y = Y;
-}(X || (X = {})), Z || (Z = {});
+//!
+//! x the name `Y` is defined multiple times
+//! ,-[30:5]
+//! 30 | import Y = X.Y;
+//! : |
+//! : `-- previous definition of `Y` here
+//! 31 |
+//! 32 | var Y = 12;
+//! : |
+//! : `-- `Y` redefined here
+//! `----
diff --git a/crates/swc/tests/tsc-references/spellingUncheckedJS_es2015.2.minified.js b/crates/swc/tests/tsc-references/spellingUncheckedJS_es2015.2.minified.js
index 7e610a19f797..bd7da8cc9ea4 100644
--- a/crates/swc/tests/tsc-references/spellingUncheckedJS_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/spellingUncheckedJS_es2015.2.minified.js
@@ -3,7 +3,5 @@ inmodule.toFixed();
var object = {
spaaace: 3
};
-object.spaaaace, object.spaace = 12, object.fresh = 12, other.puuuce, new Date().getGMTDate(), setIntegral(()=>console.log('ok'), 500), AudioBuffin, Jon, Jon;
-var other = {
- puuce: 4
-};
+object.spaaaace, object.spaace = 12, object.fresh = 12, other.puuuce, new Date().getGMTDate(), setIntegral(()=>console.log('ok'), 500), AudioBuffin, Jimmy, Jon;
+Jon;
diff --git a/crates/swc/tests/tsc-references/spellingUncheckedJS_es5.2.minified.js b/crates/swc/tests/tsc-references/spellingUncheckedJS_es5.2.minified.js
index 0ae952071b79..3b9e03f0d5b4 100644
--- a/crates/swc/tests/tsc-references/spellingUncheckedJS_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/spellingUncheckedJS_es5.2.minified.js
@@ -28,7 +28,5 @@ var Classe = function() {
};
object.spaaaace, object.spaace = 12, object.fresh = 12, other.puuuce, new Date().getGMTDate(), setIntegral(function() {
return console.log("ok");
-}, 500), AudioBuffin, Jon, Jon;
-var other = {
- puuce: 4
-};
+}, 500), AudioBuffin, Jimmy, Jon;
+Jon;
diff --git a/crates/swc/tests/tsc-references/superInStaticMembers1_es2015.1.normal.js b/crates/swc/tests/tsc-references/superInStaticMembers1_es2015.1.normal.js
index e594c52d143f..c285cdd81f2e 100644
--- a/crates/swc/tests/tsc-references/superInStaticMembers1_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/superInStaticMembers1_es2015.1.normal.js
@@ -1,16 +1,15 @@
// @target: es5, es2015, es2021, es2022, esnext
// @noTypesAndSymbols: true
// @filename: external.ts
-import _get from "@swc/helpers/src/_get.mjs";
-import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
-var _Reflect, __, _Reflect1, __1;
export class Reflect {
}
export var Baz;
(function(Baz) {})(Baz || (Baz = {}));
-class _class {
-}
-export { _class as default };
+export default class {
+};
+// @filename: locals.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = [
@@ -67,7 +66,7 @@ C._ = [
_get(_get_prototype_of(C), "w", C).call(C);
})(),
];
-var __2 = {
+var __ = {
writable: true,
value: (()=>{
var { Reflect } = {
@@ -76,7 +75,7 @@ var __2 = {
super.w();
})()
};
-var __11 = {
+var __1 = {
writable: true,
value: (()=>{
var [Reflect] = [
@@ -85,7 +84,7 @@ var __11 = {
super.w();
})()
};
-var __21 = {
+var __2 = {
writable: true,
value: (()=>{
var Reflect; // collision (es2015-es2021 only)
@@ -154,254 +153,387 @@ var __10 = {
super.w();
})()
};
+export { };
+// @filename: varInContainingScopeStaticField1.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
var Reflect = null; // collision (es2015-es2021 only)
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: varInContainingScopeStaticField2.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
var { Reflect } = {
Reflect: null
}; // collision (es2015-es2021 only)
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: varInContainingScopeStaticField3.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
var [Reflect] = [
null
]; // collision (es2015-es2021 only)
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: varInContainingScopeStaticBlock1.ts
var Reflect = null; // collision (es2015-es2021 only)
class C extends B {
}
-var __12 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: varInContainingScopeStaticBlock2.ts
var { Reflect } = {
Reflect: null
}; // collision (es2015-es2021 only)
class C extends B {
}
-var __13 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: varInContainingScopeStaticBlock3.ts
var [Reflect] = [
null
]; // collision (es2015-es2021 only)
class C extends B {
}
-var __14 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: classDeclInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class Reflect {
} // collision (es2015-es2021 only)
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: classDeclInContainingScopeStaticBlock.ts
class Reflect {
} // collision (es2015-es2021 only)
class C extends B {
}
-var __15 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: funcDeclInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
function Reflect() {} // collision (es2015-es2021 only)
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: funcDeclInContainingScopeStaticBlock.ts
function Reflect() {} // collision (es2015-es2021 only)
class C extends B {
}
-var __16 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: valueNamespaceInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: valueNamespaceInContainingScopeStaticBlock.ts
class C extends B {
}
-var __17 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: enumInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+var Reflect// collision (es2015-es2021 only)
+;
(function(Reflect) {})(Reflect || (Reflect = {}));
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: enumInContainingScopeStaticBlock.ts
+var Reflect// collision (es2015-es2021 only)
+;
(function(Reflect) {})(Reflect || (Reflect = {}));
class C extends B {
}
-var __18 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: constEnumInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+var Reflect// collision (es2015-es2021 only)
+;
(function(Reflect) {})(Reflect || (Reflect = {}));
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: constEnumInContainingScopeStaticBlock.ts
+var Reflect// collision (es2015-es2021 only)
+;
(function(Reflect) {})(Reflect || (Reflect = {}));
class C extends B {
}
-var __19 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: namespaceImportInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: namespaceImportInContainingScopeStaticBlock.ts
class C extends B {
}
-var __20 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: namedImportInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: namedImportInContainingScopeStaticBlock.ts
class C extends B {
}
-var __22 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: namedImportOfInterfaceInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: namedImportOfInterfaceInContainingScopeStaticBlock.ts
class C extends B {
}
-var __23 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: namedImportOfUninstantiatedNamespaceInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: namedImportOfUninstantiatedNamespaceInContainingScopeStaticBlock.ts
class C extends B {
}
-var __24 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: namedImportOfConstEnumInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: namedImportOfConstEnumInContainingScopeStaticBlock.ts
class C extends B {
}
-var __25 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: typeOnlyNamedImportInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: typeOnlyNamedImportInContainingScopeStaticBlock.ts
class C extends B {
}
-var __26 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: defaultImportInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: defaultImportInContainingScopeStaticBlock.ts
class C extends B {
}
-var __27 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: typeOnlyDefaultImportInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: typeOnlyDefaultImportInContainingScopeStaticBlock.ts
class C extends B {
}
-var __28 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: typeInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: typeInContainingScopeStaticBlock.ts
class C extends B {
}
-var __29 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: interfaceInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: interfaceInContainingScopeStaticBlock.ts
class C extends B {
}
-var __30 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: uninstantiatedNamespaceInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: uninstantiatedNamespaceInContainingScopeStaticBlock.ts
class C extends B {
}
-var __31 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: classExprInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
(class Reflect {
}); // no collision
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: classExprInContainingScopeStaticBlock.ts
(class Reflect {
}); // no collision
class C extends B {
}
-var __32 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: inContainingClassExprStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+var _Reflect, __;
_Reflect = class Reflect {
}, __ = {
writable: true,
@@ -411,8 +543,11 @@ _Reflect = class Reflect {
C._ = _get(_get_prototype_of(C), "w", C).call(C);
})()
}, _Reflect;
-_Reflect1 = class Reflect {
-}, __1 = {
+export { };
+// @filename: inContainingClassExprStaticBlock.ts
+var _Reflect, __;
+_Reflect = class Reflect {
+}, __ = {
writable: true,
value: (()=>{
class C extends B {
@@ -424,25 +559,37 @@ _Reflect1 = class Reflect {
})()
};
})()
-}, _Reflect1;
+}, _Reflect;
+export { };
+// @filename: funcExprInContainingScopeStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
(function Reflect() {}); // no collision
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: funcExprInContainingScopeStaticBlock.ts
(function Reflect() {}); // no collision
class C extends B {
}
-var __33 = {
+var __ = {
writable: true,
value: (()=>{
super.w();
})()
};
+export { };
+// @filename: inContainingFuncExprStaticField.ts
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
(function Reflect() {
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
});
+export { };
+// @filename: inContainingFuncExprStaticBlock.ts
(function Reflect() {
class C extends B {
}
@@ -453,3 +600,4 @@ var __33 = {
})()
};
});
+export { };
diff --git a/crates/swc/tests/tsc-references/superInStaticMembers1_es2015.2.minified.js b/crates/swc/tests/tsc-references/superInStaticMembers1_es2015.2.minified.js
index a46b5d643264..e6fa6a48d7f8 100644
--- a/crates/swc/tests/tsc-references/superInStaticMembers1_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/superInStaticMembers1_es2015.2.minified.js
@@ -1,11 +1,11 @@
-import _get from "@swc/helpers/src/_get.mjs";
-import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
export class Reflect {
}
export var Baz;
Baz || (Baz = {});
-class _class {
-}
+export default class {
+};
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = [
@@ -53,154 +53,180 @@ C._ = [
let Reflect;
Reflect || (Reflect = {}), super.w();
})(), super.w(), super.w(), super.w(), super.w();
-var Reflect = null;
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
var { Reflect } = {
Reflect: null
};
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
var [Reflect] = [
null
];
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-var Reflect = null;
-class C extends B {
-}
super.w();
+export { };
var { Reflect } = {
Reflect: null
};
-class C extends B {
-}
super.w();
+export { };
var [Reflect] = [
null
];
-class C extends B {
-}
super.w();
-class Reflect {
-}
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-class Reflect {
-}
-class C extends B {
-}
-function Reflect() {}
super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
-function Reflect() {}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-class C extends B {
-}
super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-class C extends B {
-}
-super.w(), Reflect || (Reflect = {});
-class C extends B {
-}
-C._ = _get(_get_prototype_of(C), "w", C).call(C), Reflect || (Reflect = {});
-class C extends B {
-}
-super.w(), Reflect || (Reflect = {});
-class C extends B {
-}
-C._ = _get(_get_prototype_of(C), "w", C).call(C), Reflect || (Reflect = {});
-class C extends B {
-}
super.w();
+export { };
+var Reflect;
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+Reflect || (Reflect = {});
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-class C extends B {
-}
-super.w();
+var Reflect;
+Reflect || (Reflect = {}), super.w();
+export { };
+var Reflect;
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+Reflect || (Reflect = {});
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+var Reflect;
+Reflect || (Reflect = {}), super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
+C._ = _get(_get_prototype_of(C), "w", C).call(C);
super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-class C extends B {
-}
super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-class C extends B {
-}
super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-class C extends B {
-}
super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-class C extends B {
-}
super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-class C extends B {
-}
super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-class C extends B {
-}
super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-class C extends B {
-}
super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-class C extends B {
-}
super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-class C extends B {
-}
super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
-super.w(), (()=>{
+C._ = _get(_get_prototype_of(C), "w", C).call(C);
+super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+(()=>{
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-})(), super.w();
+})();
+super.w();
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
class C extends B {
}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-class C extends B {
-}
super.w();
-export { _class as default };
+export { };
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+export { };
diff --git a/crates/swc/tests/tsc-references/superInStaticMembers1_es5.1.normal.js b/crates/swc/tests/tsc-references/superInStaticMembers1_es5.1.normal.js
index e5b8f3608a70..3b4cea3b7bf4 100644
--- a/crates/swc/tests/tsc-references/superInStaticMembers1_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/superInStaticMembers1_es5.1.normal.js
@@ -2,23 +2,24 @@
// @noTypesAndSymbols: true
// @filename: external.ts
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _get from "@swc/helpers/src/_get.mjs";
-import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
-var _this = this, _superprop_get_w = ()=>super.w;
-var _Reflect, __, _Reflect1, __1;
export var Reflect = function Reflect() {
"use strict";
_class_call_check(this, Reflect);
};
export var Baz;
(function(Baz) {})(Baz || (Baz = {}));
-var _class = function _class() {
+var _default = function _default() {
"use strict";
- _class_call_check(this, _class);
+ _class_call_check(this, _default);
};
-export { _class as default };
+export { _default as default };
+// @filename: locals.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -87,7 +88,7 @@ C._ = [
_get(_get_prototype_of(C), "w", C).call(C);
}(),
];
-var __2 = {
+var __ = {
writable: true,
value: function() {
var Reflect = {
@@ -96,14 +97,14 @@ var __2 = {
_superprop_get_w().call(_this);
}()
};
-var __11 = {
+var __1 = {
writable: true,
value: function() {
var Reflect = null; // collision (es2015-es2021 only)
_superprop_get_w().call(_this);
}()
};
-var __21 = {
+var __2 = {
writable: true,
value: function() {
var Reflect; // collision (es2015-es2021 only)
@@ -178,6 +179,13 @@ var __10 = {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: varInContainingScopeStaticField1.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var Reflect = null; // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
@@ -190,6 +198,13 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: varInContainingScopeStaticField2.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var Reflect = {
Reflect: null
}.Reflect; // collision (es2015-es2021 only)
@@ -204,6 +219,13 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: varInContainingScopeStaticField3.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var Reflect = null; // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
@@ -216,6 +238,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: varInContainingScopeStaticBlock1.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var Reflect = null; // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
@@ -227,12 +255,18 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __12 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: varInContainingScopeStaticBlock2.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var Reflect = {
Reflect: null
}.Reflect; // collision (es2015-es2021 only)
@@ -246,12 +280,18 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __13 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: varInContainingScopeStaticBlock3.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var Reflect = null; // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
@@ -263,12 +303,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __14 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: classDeclInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var Reflect = function Reflect() {
"use strict";
_class_call_check(this, Reflect);
@@ -285,6 +332,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: classDeclInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var Reflect = function Reflect() {
"use strict";
_class_call_check(this, Reflect);
@@ -300,12 +353,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __15 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: funcDeclInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
function Reflect() {} // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
@@ -318,6 +378,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: funcDeclInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
function Reflect() {} // collision (es2015-es2021 only)
var C = /*#__PURE__*/ function(B1) {
"use strict";
@@ -329,12 +395,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __16 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: valueNamespaceInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -346,6 +419,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: valueNamespaceInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -356,12 +435,21 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __17 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: enumInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var Reflect// collision (es2015-es2021 only)
+;
(function(Reflect) {})(Reflect || (Reflect = {}));
var C = /*#__PURE__*/ function(B1) {
"use strict";
@@ -374,6 +462,14 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: enumInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
+var Reflect// collision (es2015-es2021 only)
+;
(function(Reflect) {})(Reflect || (Reflect = {}));
var C = /*#__PURE__*/ function(B1) {
"use strict";
@@ -385,12 +481,21 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __18 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: constEnumInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var Reflect// collision (es2015-es2021 only)
+;
(function(Reflect) {})(Reflect || (Reflect = {}));
var C = /*#__PURE__*/ function(B1) {
"use strict";
@@ -403,6 +508,14 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: constEnumInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
+var Reflect// collision (es2015-es2021 only)
+;
(function(Reflect) {})(Reflect || (Reflect = {}));
var C = /*#__PURE__*/ function(B1) {
"use strict";
@@ -414,12 +527,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __19 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: namespaceImportInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -431,6 +551,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: namespaceImportInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -441,12 +567,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __20 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: namedImportInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -458,6 +591,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: namedImportInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -468,12 +607,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __22 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: namedImportOfInterfaceInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -485,6 +631,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: namedImportOfInterfaceInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -495,12 +647,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __23 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: namedImportOfUninstantiatedNamespaceInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -512,6 +671,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: namedImportOfUninstantiatedNamespaceInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -522,12 +687,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __24 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: namedImportOfConstEnumInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -539,6 +711,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: namedImportOfConstEnumInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -549,12 +727,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __25 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: typeOnlyNamedImportInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -566,6 +751,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: typeOnlyNamedImportInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -576,12 +767,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __26 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: defaultImportInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -593,6 +791,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: defaultImportInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -603,12 +807,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __27 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: typeOnlyDefaultImportInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -620,6 +831,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: typeOnlyDefaultImportInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -630,12 +847,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __28 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: typeInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -647,6 +871,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: typeInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -657,12 +887,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __29 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: interfaceInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -674,6 +911,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: interfaceInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -684,12 +927,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __30 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: uninstantiatedNamespaceInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -701,6 +951,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: uninstantiatedNamespaceInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
var C = /*#__PURE__*/ function(B1) {
"use strict";
_inherits(C, B1);
@@ -711,12 +967,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __31 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: classExprInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
(function Reflect() {
"use strict";
_class_call_check(this, Reflect);
@@ -732,6 +995,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: classExprInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
(function Reflect() {
"use strict";
_class_call_check(this, Reflect);
@@ -746,12 +1015,20 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __32 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: inContainingClassExprStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _Reflect, __;
_Reflect = function Reflect() {
"use strict";
_class_call_check(this, Reflect);
@@ -771,10 +1048,17 @@ _Reflect = function Reflect() {
C._ = _get(_get_prototype_of(C), "w", C).call(C);
}()
}, _Reflect;
-_Reflect1 = function Reflect() {
+export { };
+// @filename: inContainingClassExprStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
+var _Reflect, __;
+_Reflect = function Reflect() {
"use strict";
_class_call_check(this, Reflect);
-}, __1 = {
+}, __ = {
writable: true,
value: function() {
var C = /*#__PURE__*/ function(B1) {
@@ -794,7 +1078,14 @@ _Reflect1 = function Reflect() {
}()
};
}()
-}, _Reflect1;
+}, _Reflect;
+export { };
+// @filename: funcExprInContainingScopeStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
(function Reflect() {}); // no collision
var C = /*#__PURE__*/ function(B1) {
"use strict";
@@ -807,6 +1098,12 @@ var C = /*#__PURE__*/ function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+export { };
+// @filename: funcExprInContainingScopeStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
(function Reflect() {}); // no collision
var C = /*#__PURE__*/ function(B1) {
"use strict";
@@ -818,12 +1115,19 @@ var C = /*#__PURE__*/ function(B1) {
}
return C;
}(B);
-var __33 = {
+var __ = {
writable: true,
value: function() {
_superprop_get_w().call(_this);
}()
};
+export { };
+// @filename: inContainingFuncExprStaticField.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
(function Reflect() {
var C = /*#__PURE__*/ function(B1) {
"use strict";
@@ -837,6 +1141,11 @@ var __33 = {
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
});
+export { };
+// @filename: inContainingFuncExprStaticBlock.ts
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
(function Reflect() {
var _this = this, _superprop_get_w = ()=>super.w;
var C = /*#__PURE__*/ function(B1) {
@@ -856,3 +1165,4 @@ var __33 = {
}()
};
});
+export { };
diff --git a/crates/swc/tests/tsc-references/superInStaticMembers1_es5.2.minified.js b/crates/swc/tests/tsc-references/superInStaticMembers1_es5.2.minified.js
index 4e7fec571f19..8fc3d4e80cce 100644
--- a/crates/swc/tests/tsc-references/superInStaticMembers1_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/superInStaticMembers1_es5.2.minified.js
@@ -1,20 +1,21 @@
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-import _get from "@swc/helpers/src/_get.mjs";
-import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
-var _this = this, _superprop_get_w = ()=>super.w;
export var Reflect = function() {
"use strict";
_class_call_check(this, Reflect);
};
export var Baz;
Baz || (Baz = {});
-var _class = function() {
+var _default = function() {
"use strict";
- _class_call_check(this, _class);
+ _class_call_check(this, _default);
};
-var C = function(B1) {
+export { _default as default };
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w, C = function(B1) {
"use strict";
_inherits(C, B1);
var _super = _create_super(C);
@@ -60,7 +61,12 @@ C._ = [
var Reflect;
Reflect || (Reflect = {}), _superprop_get_w().call(_this);
}(), _superprop_get_w().call(_this), _superprop_get_w().call(_this), _superprop_get_w().call(_this), _superprop_get_w().call(_this);
-var Reflect = null, C = function(B1) {
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var C = function(B1) {
"use strict";
_inherits(C, B1);
var _super = _create_super(C);
@@ -70,7 +76,12 @@ var Reflect = null, C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-var Reflect = null, C = function(B1) {
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var C = function(B1) {
"use strict";
_inherits(C, B1);
var _super = _create_super(C);
@@ -80,7 +91,12 @@ var Reflect = null, C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-var Reflect = null, C = function(B1) {
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var C = function(B1) {
"use strict";
_inherits(C, B1);
var _super = _create_super(C);
@@ -90,7 +106,10 @@ var Reflect = null, C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-var Reflect = null, C = function(B1) {
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var C = function(B1) {
"use strict";
_inherits(C, B1);
var _super = _create_super(C);
@@ -99,8 +118,11 @@ var Reflect = null, C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
-var Reflect = null, C = function(B1) {
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var C = function(B1) {
"use strict";
_inherits(C, B1);
var _super = _create_super(C);
@@ -109,8 +131,11 @@ var Reflect = null, C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
-var Reflect = null, C = function(B1) {
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var C = function(B1) {
"use strict";
_inherits(C, B1);
var _super = _create_super(C);
@@ -119,7 +144,12 @@ var Reflect = null, C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var Reflect = function() {
"use strict";
_class_call_check(this, Reflect);
@@ -133,6 +163,9 @@ var Reflect = function() {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var Reflect = function() {
"use strict";
_class_call_check(this, Reflect);
@@ -145,8 +178,12 @@ var Reflect = function() {
}
return C;
}(B);
-function Reflect() {}
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -156,8 +193,10 @@ var C = function(B1) {
}
return C;
}(B);
-function Reflect() {}
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -167,7 +206,12 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -178,6 +222,9 @@ var C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -187,8 +234,14 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this), Reflect || (Reflect = {});
-var C = function(B1) {
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+Reflect || (Reflect = {});
+var Reflect, C = function(B1) {
"use strict";
_inherits(C, B1);
var _super = _create_super(C);
@@ -197,8 +250,12 @@ var C = function(B1) {
}
return C;
}(B);
-C._ = _get(_get_prototype_of(C), "w", C).call(C), Reflect || (Reflect = {});
-var C = function(B1) {
+C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+Reflect || (Reflect = {});
+var Reflect, C = function(B1) {
"use strict";
_inherits(C, B1);
var _super = _create_super(C);
@@ -207,8 +264,14 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this), Reflect || (Reflect = {});
-var C = function(B1) {
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+Reflect || (Reflect = {});
+var Reflect, C = function(B1) {
"use strict";
_inherits(C, B1);
var _super = _create_super(C);
@@ -217,8 +280,12 @@ var C = function(B1) {
}
return C;
}(B);
-C._ = _get(_get_prototype_of(C), "w", C).call(C), Reflect || (Reflect = {});
-var C = function(B1) {
+C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+Reflect || (Reflect = {});
+var Reflect, C = function(B1) {
"use strict";
_inherits(C, B1);
var _super = _create_super(C);
@@ -227,7 +294,12 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -238,6 +310,9 @@ var C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -247,7 +322,12 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -258,6 +338,9 @@ var C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -267,7 +350,12 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -278,6 +366,9 @@ var C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -287,7 +378,12 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -298,6 +394,9 @@ var C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -307,7 +406,12 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -318,6 +422,9 @@ var C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -327,7 +434,12 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -338,6 +450,9 @@ var C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -347,7 +462,12 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -358,6 +478,9 @@ var C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -367,7 +490,12 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -378,6 +506,9 @@ var C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -387,7 +518,12 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -398,6 +534,9 @@ var C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -407,7 +546,12 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -418,6 +562,9 @@ var C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -427,7 +574,12 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -438,6 +590,9 @@ var C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -447,7 +602,12 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -458,6 +618,9 @@ var C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -467,7 +630,13 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this), function() {
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+!function() {
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -478,7 +647,12 @@ _superprop_get_w().call(_this), function() {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
-}(), function() {
+}();
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var _this = this, _superprop_get_w = ()=>super.w;
+!function() {
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -490,6 +664,11 @@ _superprop_get_w().call(_this), function() {
}(B);
_superprop_get_w().call(_this);
}();
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -500,6 +679,9 @@ var C = function(B1) {
return C;
}(B);
C._ = _get(_get_prototype_of(C), "w", C).call(C);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
var C = function(B1) {
"use strict";
_inherits(C, B1);
@@ -509,5 +691,12 @@ var C = function(B1) {
}
return C;
}(B);
-_superprop_get_w().call(_this);
-export { _class as default };
+super.w.call(this);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _get from "@swc/helpers/src/_get.mjs";
+import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
diff --git a/crates/swc/tests/tsc-references/symbolType20_es2015.1.normal.js b/crates/swc/tests/tsc-references/symbolType20_es2015.1.normal.js
new file mode 100644
index 000000000000..1437554dc599
--- /dev/null
+++ b/crates/swc/tests/tsc-references/symbolType20_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x interface name is invalid
+//! ,----
+//! 2 | interface symbol { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/symbolType20_es2015.2.minified.js b/crates/swc/tests/tsc-references/symbolType20_es2015.2.minified.js
new file mode 100644
index 000000000000..1437554dc599
--- /dev/null
+++ b/crates/swc/tests/tsc-references/symbolType20_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x interface name is invalid
+//! ,----
+//! 2 | interface symbol { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/symbolType20_es5.1.normal.js b/crates/swc/tests/tsc-references/symbolType20_es5.1.normal.js
new file mode 100644
index 000000000000..1437554dc599
--- /dev/null
+++ b/crates/swc/tests/tsc-references/symbolType20_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x interface name is invalid
+//! ,----
+//! 2 | interface symbol { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/symbolType20_es5.2.minified.js b/crates/swc/tests/tsc-references/symbolType20_es5.2.minified.js
new file mode 100644
index 000000000000..1437554dc599
--- /dev/null
+++ b/crates/swc/tests/tsc-references/symbolType20_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x interface name is invalid
+//! ,----
+//! 2 | interface symbol { }
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/templateStringInDeleteExpressionES6_es2015.1.normal.js b/crates/swc/tests/tsc-references/templateStringInDeleteExpressionES6_es2015.1.normal.js
new file mode 100644
index 000000000000..640555632dfe
--- /dev/null
+++ b/crates/swc/tests/tsc-references/templateStringInDeleteExpressionES6_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 2 | delete `abc${0}abc`;
+//! : ^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/templateStringInDeleteExpressionES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/templateStringInDeleteExpressionES6_es2015.2.minified.js
new file mode 100644
index 000000000000..640555632dfe
--- /dev/null
+++ b/crates/swc/tests/tsc-references/templateStringInDeleteExpressionES6_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 2 | delete `abc${0}abc`;
+//! : ^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/templateStringInDeleteExpressionES6_es5.1.normal.js b/crates/swc/tests/tsc-references/templateStringInDeleteExpressionES6_es5.1.normal.js
new file mode 100644
index 000000000000..640555632dfe
--- /dev/null
+++ b/crates/swc/tests/tsc-references/templateStringInDeleteExpressionES6_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 2 | delete `abc${0}abc`;
+//! : ^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/templateStringInDeleteExpressionES6_es5.2.minified.js b/crates/swc/tests/tsc-references/templateStringInDeleteExpressionES6_es5.2.minified.js
new file mode 100644
index 000000000000..640555632dfe
--- /dev/null
+++ b/crates/swc/tests/tsc-references/templateStringInDeleteExpressionES6_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 2 | delete `abc${0}abc`;
+//! : ^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/templateStringInDeleteExpression_es2015.1.normal.js b/crates/swc/tests/tsc-references/templateStringInDeleteExpression_es2015.1.normal.js
new file mode 100644
index 000000000000..a69b80195724
--- /dev/null
+++ b/crates/swc/tests/tsc-references/templateStringInDeleteExpression_es2015.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 1 | delete `abc${0}abc`;
+//! : ^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/templateStringInDeleteExpression_es2015.2.minified.js b/crates/swc/tests/tsc-references/templateStringInDeleteExpression_es2015.2.minified.js
new file mode 100644
index 000000000000..a69b80195724
--- /dev/null
+++ b/crates/swc/tests/tsc-references/templateStringInDeleteExpression_es2015.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 1 | delete `abc${0}abc`;
+//! : ^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/templateStringInDeleteExpression_es5.1.normal.js b/crates/swc/tests/tsc-references/templateStringInDeleteExpression_es5.1.normal.js
new file mode 100644
index 000000000000..a69b80195724
--- /dev/null
+++ b/crates/swc/tests/tsc-references/templateStringInDeleteExpression_es5.1.normal.js
@@ -0,0 +1,12 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 1 | delete `abc${0}abc`;
+//! : ^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/templateStringInDeleteExpression_es5.2.minified.js b/crates/swc/tests/tsc-references/templateStringInDeleteExpression_es5.2.minified.js
new file mode 100644
index 000000000000..a69b80195724
--- /dev/null
+++ b/crates/swc/tests/tsc-references/templateStringInDeleteExpression_es5.2.minified.js
@@ -0,0 +1,12 @@
+//!
+//! x The operand of a delete operator must be a property reference.
+//! ,----
+//! 1 | delete `abc${0}abc`;
+//! : ^^^^^^^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es2015.2.minified.js b/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es2015.2.minified.js
new file mode 100644
index 000000000000..76e945c3c683
--- /dev/null
+++ b/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es2015.2.minified.js
@@ -0,0 +1,5 @@
+class Bar extends Foo {
+ constructor(){
+ super(), this.p = 2;
+ }
+}
diff --git a/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.1.normal.js b/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.1.normal.js
index 457fcfa50ae1..d66bb86a4af2 100644
--- a/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.1.normal.js
@@ -5,8 +5,6 @@
// @Filename: foo.ts
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _create_class from "@swc/helpers/src/_create_class.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
var Foo = /*#__PURE__*/ function() {
"use strict";
function Foo() {
@@ -24,9 +22,12 @@ var Foo = /*#__PURE__*/ function() {
return Foo;
}();
// @Filename: bar.js
-var Bar = /*#__PURE__*/ function(Foo) {
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var Bar = /*#__PURE__*/ function(Foo1) {
"use strict";
- _inherits(Bar, Foo);
+ _inherits(Bar, Foo1);
var _super = _create_super(Bar);
function Bar() {
_class_call_check(this, Bar);
diff --git a/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.2.minified.js b/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.2.minified.js
index cb9751f13800..c65291ff098b 100644
--- a/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/thisPropertyOverridesAccessors_es5.2.minified.js
@@ -1,7 +1,5 @@
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _create_class from "@swc/helpers/src/_create_class.mjs";
-import _inherits from "@swc/helpers/src/_inherits.mjs";
-import _create_super from "@swc/helpers/src/_create_super.mjs";
var Foo = function() {
"use strict";
function Foo() {
@@ -16,9 +14,13 @@ var Foo = function() {
set: function(value) {}
}
]), Foo;
-}(), Bar = function(Foo) {
+}();
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
+var Bar = function(Foo1) {
"use strict";
- _inherits(Bar, Foo);
+ _inherits(Bar, Foo1);
var _super = _create_super(Bar);
function Bar() {
var _this;
diff --git a/crates/swc/tests/tsc-references/topLevelAwait.2_es2015.1.normal.js b/crates/swc/tests/tsc-references/topLevelAwait.2_es2015.1.normal.js
new file mode 100644
index 000000000000..15cbb3bba258
--- /dev/null
+++ b/crates/swc/tests/tsc-references/topLevelAwait.2_es2015.1.normal.js
@@ -0,0 +1,11 @@
+//!
+//! x Expected 'from', got 'await'
+//! ,----
+//! 7 | import await = foo.await;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/topLevelAwait.2_es2015.2.minified.js b/crates/swc/tests/tsc-references/topLevelAwait.2_es2015.2.minified.js
new file mode 100644
index 000000000000..15cbb3bba258
--- /dev/null
+++ b/crates/swc/tests/tsc-references/topLevelAwait.2_es2015.2.minified.js
@@ -0,0 +1,11 @@
+//!
+//! x Expected 'from', got 'await'
+//! ,----
+//! 7 | import await = foo.await;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/topLevelAwait.2_es5.1.normal.js b/crates/swc/tests/tsc-references/topLevelAwait.2_es5.1.normal.js
new file mode 100644
index 000000000000..15cbb3bba258
--- /dev/null
+++ b/crates/swc/tests/tsc-references/topLevelAwait.2_es5.1.normal.js
@@ -0,0 +1,11 @@
+//!
+//! x Expected 'from', got 'await'
+//! ,----
+//! 7 | import await = foo.await;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/topLevelAwait.2_es5.2.minified.js b/crates/swc/tests/tsc-references/topLevelAwait.2_es5.2.minified.js
new file mode 100644
index 000000000000..15cbb3bba258
--- /dev/null
+++ b/crates/swc/tests/tsc-references/topLevelAwait.2_es5.2.minified.js
@@ -0,0 +1,11 @@
+//!
+//! x Expected 'from', got 'await'
+//! ,----
+//! 7 | import await = foo.await;
+//! : ^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es2015.1.normal.js b/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es2015.1.normal.js
index 9297b4eb3863..7325c270e30d 100644
--- a/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es2015.1.normal.js
@@ -4,3 +4,4 @@ export var x;
// @Filename: foo_1.ts
const foo = require("vs/foo");
var z = foo.x + 10;
+export { };
diff --git a/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es2015.2.minified.js b/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es2015.2.minified.js
index 84eea32b944e..3ab9a5972d94 100644
--- a/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es2015.2.minified.js
@@ -1,3 +1,4 @@
export var x;
let foo = require("vs/foo");
foo.x;
+export { };
diff --git a/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es5.1.normal.js b/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es5.1.normal.js
index f14d993a1787..8309d5217de2 100644
--- a/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es5.1.normal.js
@@ -4,3 +4,4 @@ export var x;
// @Filename: foo_1.ts
var foo = require("vs/foo");
var z = foo.x + 10;
+export { };
diff --git a/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es5.2.minified.js b/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es5.2.minified.js
index 73062ce1c66d..2129037c8e7c 100644
--- a/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/topLevelFileModuleMissing_es5.2.minified.js
@@ -1,2 +1,3 @@
export var x;
require("vs/foo").x;
+export { };
diff --git a/crates/swc/tests/tsc-references/topLevelFileModule_es2015.1.normal.js b/crates/swc/tests/tsc-references/topLevelFileModule_es2015.1.normal.js
index 616ba980f6c6..ab3840ca5f76 100644
--- a/crates/swc/tests/tsc-references/topLevelFileModule_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/topLevelFileModule_es2015.1.normal.js
@@ -1,7 +1,10 @@
// @module: commonjs
// @Filename: vs/foo_0.ts
export var x;
+// @Filename: vs/fum.d.ts
+export { };
// @Filename: foo_1.ts
const foo = require("./vs/foo_0");
const fum = require("./vs/fum");
var z = foo.x + fum.y;
+export { };
diff --git a/crates/swc/tests/tsc-references/topLevelFileModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/topLevelFileModule_es2015.2.minified.js
index 11c3ba5b3f39..3637ea5ef478 100644
--- a/crates/swc/tests/tsc-references/topLevelFileModule_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/topLevelFileModule_es2015.2.minified.js
@@ -1,3 +1,5 @@
export var x;
+export { };
let foo = require("./vs/foo_0"), fum = require("./vs/fum");
foo.x, fum.y;
+export { };
diff --git a/crates/swc/tests/tsc-references/topLevelFileModule_es5.1.normal.js b/crates/swc/tests/tsc-references/topLevelFileModule_es5.1.normal.js
index c280a277cebc..20b12a20f244 100644
--- a/crates/swc/tests/tsc-references/topLevelFileModule_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/topLevelFileModule_es5.1.normal.js
@@ -1,7 +1,10 @@
// @module: commonjs
// @Filename: vs/foo_0.ts
export var x;
+// @Filename: vs/fum.d.ts
+export { };
// @Filename: foo_1.ts
var foo = require("./vs/foo_0");
var fum = require("./vs/fum");
var z = foo.x + fum.y;
+export { };
diff --git a/crates/swc/tests/tsc-references/topLevelFileModule_es5.2.minified.js b/crates/swc/tests/tsc-references/topLevelFileModule_es5.2.minified.js
index d54ffe6cfdd3..4e24ba180587 100644
--- a/crates/swc/tests/tsc-references/topLevelFileModule_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/topLevelFileModule_es5.2.minified.js
@@ -1,3 +1,5 @@
export var x;
+export { };
var foo = require("./vs/foo_0"), fum = require("./vs/fum");
foo.x, fum.y;
+export { };
diff --git a/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es2015.1.normal.js b/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es2015.1.normal.js
index 3940379cd802..1a6ab2035dd6 100644
--- a/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es2015.1.normal.js
@@ -1,8 +1,10 @@
// @module: commonjs
// @Filename: vs/foo_0/index.ts
export var x = 42;
+// @Filename: foo_1.ts
// @Filename: foo_2.ts
///
const foo = require("vs/foo_0");
var z1 = foo.x + 10; // Should error, as declaration should win
var z2 = foo.y() + 10; // Should resolve
+export { };
diff --git a/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es2015.2.minified.js b/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es2015.2.minified.js
index e24ae570773e..9f0d0e66d1cd 100644
--- a/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es2015.2.minified.js
@@ -1,3 +1,4 @@
export var x = 42;
let foo = require("vs/foo_0");
foo.x, foo.y();
+export { };
diff --git a/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es5.1.normal.js b/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es5.1.normal.js
index 07d2f4a31b8d..ca106624ff12 100644
--- a/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es5.1.normal.js
@@ -1,8 +1,10 @@
// @module: commonjs
// @Filename: vs/foo_0/index.ts
export var x = 42;
+// @Filename: foo_1.ts
// @Filename: foo_2.ts
///
var foo = require("vs/foo_0");
var z1 = foo.x + 10; // Should error, as declaration should win
var z2 = foo.y() + 10; // Should resolve
+export { };
diff --git a/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es5.2.minified.js b/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es5.2.minified.js
index 2193b7e975f4..8e81271f91db 100644
--- a/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/topLevelModuleDeclarationAndFile_es5.2.minified.js
@@ -1,3 +1,4 @@
export var x = 42;
var foo = require("vs/foo_0");
foo.x, foo.y();
+export { };
diff --git a/crates/swc/tests/tsc-references/topLevelThisAssignment_es2015.2.minified.js b/crates/swc/tests/tsc-references/topLevelThisAssignment_es2015.2.minified.js
index 0828aef182fb..870953e1229e 100644
--- a/crates/swc/tests/tsc-references/topLevelThisAssignment_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/topLevelThisAssignment_es2015.2.minified.js
@@ -1 +1,2 @@
-this.a = 10, this.a, a, this.a, a;
+this.a = 10, this.a, a;
+this.a, a;
diff --git a/crates/swc/tests/tsc-references/topLevelThisAssignment_es5.2.minified.js b/crates/swc/tests/tsc-references/topLevelThisAssignment_es5.2.minified.js
index 0828aef182fb..870953e1229e 100644
--- a/crates/swc/tests/tsc-references/topLevelThisAssignment_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/topLevelThisAssignment_es5.2.minified.js
@@ -1 +1,2 @@
-this.a = 10, this.a, a, this.a, a;
+this.a = 10, this.a, a;
+this.a, a;
diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution10_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution10_es5.1.normal.js
index dba02a051a92..182a142cfdb8 100644
--- a/crates/swc/tests/tsc-references/tsxAttributeResolution10_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxAttributeResolution10_es5.1.normal.js
@@ -1,8 +1,8 @@
//@jsx: preserve
//@module: amd
//@filename: react.d.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
//@filename: file.tsx
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var MyComponent = /*#__PURE__*/ function() {
"use strict";
function MyComponent() {
diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution11_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution11_es5.1.normal.js
index 7dc630a491c3..ad5783b45b5b 100644
--- a/crates/swc/tests/tsc-references/tsxAttributeResolution11_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxAttributeResolution11_es5.1.normal.js
@@ -1,8 +1,8 @@
//@jsx: preserve
//@module: amd
//@filename: react.d.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
//@filename: file.tsx
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var MyComponent = /*#__PURE__*/ function() {
"use strict";
function MyComponent() {
diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution12_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution12_es2015.1.normal.js
index 91ec6dc08441..33959bb742e0 100644
--- a/crates/swc/tests/tsc-references/tsxAttributeResolution12_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxAttributeResolution12_es2015.1.normal.js
@@ -1,5 +1,6 @@
//@jsx: preserve
//@filename: react.d.ts
+//@filename: file.tsx
// Errors correctly
const T = TestMod.Test;
var t1 = /*#__PURE__*/ React.createElement(T, null);
diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution12_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution12_es5.1.normal.js
index 5808537df387..f2961f416bb5 100644
--- a/crates/swc/tests/tsc-references/tsxAttributeResolution12_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxAttributeResolution12_es5.1.normal.js
@@ -1,5 +1,6 @@
//@jsx: preserve
//@filename: react.d.ts
+//@filename: file.tsx
// Errors correctly
var T = TestMod.Test;
var t1 = /*#__PURE__*/ React.createElement(T, null);
diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution14_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution14_es2015.1.normal.js
index b769a57b23a0..0ecf3596017c 100644
--- a/crates/swc/tests/tsc-references/tsxAttributeResolution14_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxAttributeResolution14_es2015.1.normal.js
@@ -1,6 +1,7 @@
//@jsx: preserve
//@module: amd
//@filename: react.d.ts
+//@filename: file.tsx
function VerticalNavMenuItem(prop) {
return /*#__PURE__*/ React.createElement("div", null, "props.primaryText");
}
diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution14_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution14_es5.1.normal.js
index b769a57b23a0..0ecf3596017c 100644
--- a/crates/swc/tests/tsc-references/tsxAttributeResolution14_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxAttributeResolution14_es5.1.normal.js
@@ -1,6 +1,7 @@
//@jsx: preserve
//@module: amd
//@filename: react.d.ts
+//@filename: file.tsx
function VerticalNavMenuItem(prop) {
return /*#__PURE__*/ React.createElement("div", null, "props.primaryText");
}
diff --git a/crates/swc/tests/tsc-references/tsxAttributeResolution9_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeResolution9_es5.1.normal.js
index 5f9b8eefddcd..41bdb4f154f6 100644
--- a/crates/swc/tests/tsc-references/tsxAttributeResolution9_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxAttributeResolution9_es5.1.normal.js
@@ -1,8 +1,8 @@
//@jsx: preserve
//@module: amd
//@filename: react.d.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
//@filename: file.tsx
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var MyComponent = /*#__PURE__*/ function() {
"use strict";
function MyComponent() {
diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName5_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName5_es5.1.normal.js
index e9668ceadcce..20925048fecf 100644
--- a/crates/swc/tests/tsc-references/tsxDynamicTagName5_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxDynamicTagName5_es5.1.normal.js
@@ -1,9 +1,9 @@
// @jsx: preserve
//@filename: react.d.ts
+//@filename: app.tsx
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _inherits from "@swc/helpers/src/_inherits.mjs";
import _create_super from "@swc/helpers/src/_create_super.mjs";
-//@filename: app.tsx
import * as React from "react";
export var Text = /*#__PURE__*/ function(_Component) {
"use strict";
diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName7_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName7_es5.1.normal.js
index 75982ed903bb..565058356ec3 100644
--- a/crates/swc/tests/tsc-references/tsxDynamicTagName7_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxDynamicTagName7_es5.1.normal.js
@@ -1,9 +1,9 @@
// @jsx: preserve
//@filename: react.d.ts
+//@filename: app.tsx
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _inherits from "@swc/helpers/src/_inherits.mjs";
import _create_super from "@swc/helpers/src/_create_super.mjs";
-//@filename: app.tsx
import * as React from "react";
export var Text = /*#__PURE__*/ function(_Component) {
"use strict";
diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName8_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName8_es5.1.normal.js
index 71958fd54c13..63fdf5bb09d0 100644
--- a/crates/swc/tests/tsc-references/tsxDynamicTagName8_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxDynamicTagName8_es5.1.normal.js
@@ -1,9 +1,9 @@
// @jsx: preserve
//@filename: react.d.ts
+//@filename: app.tsx
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _inherits from "@swc/helpers/src/_inherits.mjs";
import _create_super from "@swc/helpers/src/_create_super.mjs";
-//@filename: app.tsx
import * as React from "react";
export var Text = /*#__PURE__*/ function(_Component) {
"use strict";
diff --git a/crates/swc/tests/tsc-references/tsxDynamicTagName9_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxDynamicTagName9_es5.1.normal.js
index 71958fd54c13..63fdf5bb09d0 100644
--- a/crates/swc/tests/tsc-references/tsxDynamicTagName9_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxDynamicTagName9_es5.1.normal.js
@@ -1,9 +1,9 @@
// @jsx: preserve
//@filename: react.d.ts
+//@filename: app.tsx
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _inherits from "@swc/helpers/src/_inherits.mjs";
import _create_super from "@swc/helpers/src/_create_super.mjs";
-//@filename: app.tsx
import * as React from "react";
export var Text = /*#__PURE__*/ function(_Component) {
"use strict";
diff --git a/crates/swc/tests/tsc-references/tsxElementResolution19_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxElementResolution19_es2015.1.normal.js
index ed875f9b8cc0..2a59e5eef8a8 100644
--- a/crates/swc/tests/tsc-references/tsxElementResolution19_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxElementResolution19_es2015.1.normal.js
@@ -1,9 +1,11 @@
//@jsx: react
//@module: amd
//@filename: react.d.ts
+//@filename: file1.tsx
export class MyClass {
}
//@filename: file2.tsx
// Should not elide React import
import * as React from 'react';
+import { MyClass } from './file1';
/*#__PURE__*/ React.createElement(MyClass, null);
diff --git a/crates/swc/tests/tsc-references/tsxElementResolution19_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxElementResolution19_es2015.2.minified.js
index 872305ca6a91..4d1d37f75385 100644
--- a/crates/swc/tests/tsc-references/tsxElementResolution19_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxElementResolution19_es2015.2.minified.js
@@ -1,3 +1,4 @@
export class MyClass {
}
import * as React from 'react';
+import { MyClass } from './file1';
diff --git a/crates/swc/tests/tsc-references/tsxElementResolution19_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxElementResolution19_es5.1.normal.js
index 456b559419ac..dc4fa79c00e5 100644
--- a/crates/swc/tests/tsc-references/tsxElementResolution19_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxElementResolution19_es5.1.normal.js
@@ -1,6 +1,7 @@
//@jsx: react
//@module: amd
//@filename: react.d.ts
+//@filename: file1.tsx
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var MyClass = function MyClass() {
"use strict";
@@ -9,4 +10,5 @@ export var MyClass = function MyClass() {
//@filename: file2.tsx
// Should not elide React import
import * as React from "react";
+import { MyClass } from "./file1";
/*#__PURE__*/ React.createElement(MyClass, null);
diff --git a/crates/swc/tests/tsc-references/tsxElementResolution19_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxElementResolution19_es5.2.minified.js
index 2c2652c2f0aa..472626db6366 100644
--- a/crates/swc/tests/tsc-references/tsxElementResolution19_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxElementResolution19_es5.2.minified.js
@@ -4,3 +4,4 @@ export var MyClass = function() {
_class_call_check(this, MyClass);
};
import * as React from "react";
+import { MyClass } from "./file1";
diff --git a/crates/swc/tests/tsc-references/tsxErrorRecovery2_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxErrorRecovery2_es2015.1.normal.js
new file mode 100644
index 000000000000..7415e087826c
--- /dev/null
+++ b/crates/swc/tests/tsc-references/tsxErrorRecovery2_es2015.1.normal.js
@@ -0,0 +1,25 @@
+//@jsx: preserve
+//@filename: file1.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 4 |
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
+//@filename: file2.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 2 | var x =
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/tsxErrorRecovery2_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxErrorRecovery2_es2015.2.minified.js
new file mode 100644
index 000000000000..0368778b2b49
--- /dev/null
+++ b/crates/swc/tests/tsc-references/tsxErrorRecovery2_es2015.2.minified.js
@@ -0,0 +1,24 @@
+//@filename: file1.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 4 |
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
+//@filename: file2.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 2 | var x =
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/tsxErrorRecovery2_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxErrorRecovery2_es5.1.normal.js
new file mode 100644
index 000000000000..7415e087826c
--- /dev/null
+++ b/crates/swc/tests/tsc-references/tsxErrorRecovery2_es5.1.normal.js
@@ -0,0 +1,25 @@
+//@jsx: preserve
+//@filename: file1.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 4 |
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
+//@filename: file2.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 2 | var x =
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/tsxErrorRecovery2_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxErrorRecovery2_es5.2.minified.js
new file mode 100644
index 000000000000..0368778b2b49
--- /dev/null
+++ b/crates/swc/tests/tsc-references/tsxErrorRecovery2_es5.2.minified.js
@@ -0,0 +1,24 @@
+//@filename: file1.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 4 |
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
+//@filename: file2.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 2 | var x =
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/tsxErrorRecovery3_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxErrorRecovery3_es2015.1.normal.js
new file mode 100644
index 000000000000..ce42981c6d3e
--- /dev/null
+++ b/crates/swc/tests/tsc-references/tsxErrorRecovery3_es2015.1.normal.js
@@ -0,0 +1,25 @@
+//@jsx: react
+//@filename: file1.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 4 |
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
+//@filename: file2.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 2 | var x =
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/tsxErrorRecovery3_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxErrorRecovery3_es2015.2.minified.js
new file mode 100644
index 000000000000..0368778b2b49
--- /dev/null
+++ b/crates/swc/tests/tsc-references/tsxErrorRecovery3_es2015.2.minified.js
@@ -0,0 +1,24 @@
+//@filename: file1.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 4 |
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
+//@filename: file2.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 2 | var x =
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/tsxErrorRecovery3_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxErrorRecovery3_es5.1.normal.js
new file mode 100644
index 000000000000..ce42981c6d3e
--- /dev/null
+++ b/crates/swc/tests/tsc-references/tsxErrorRecovery3_es5.1.normal.js
@@ -0,0 +1,25 @@
+//@jsx: react
+//@filename: file1.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 4 |
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
+//@filename: file2.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 2 | var x =
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/tsxErrorRecovery3_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxErrorRecovery3_es5.2.minified.js
new file mode 100644
index 000000000000..0368778b2b49
--- /dev/null
+++ b/crates/swc/tests/tsc-references/tsxErrorRecovery3_es5.2.minified.js
@@ -0,0 +1,24 @@
+//@filename: file1.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 4 |
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
+//@filename: file2.tsx
+//!
+//! x Unexpected token `div`. Expected jsx identifier
+//! ,----
+//! 2 | var x =
+//! : ^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es2015.1.normal.js
index 4a1e1014f029..044cdd349422 100644
--- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es2015.1.normal.js
@@ -3,6 +3,8 @@
//@filename: react.d.ts
//@filename: app.tsx
import * as React from 'react';
+// Should see var button_1 = require('./button') here
+import { Button } from './button';
export class App extends React.Component {
render() {
return /*#__PURE__*/ React.createElement(Button, null);
diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es2015.2.minified.js
index 5bee802a3d2c..2e65f82ac7d0 100644
--- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es2015.2.minified.js
@@ -1,4 +1,5 @@
import * as React from 'react';
+import { Button } from './button';
export class App extends React.Component {
render() {
return React.createElement(Button, null);
diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es5.1.normal.js
index c91d61183862..5328834d5d1b 100644
--- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es5.1.normal.js
@@ -1,11 +1,13 @@
//@jsx: preserve
//@module: commonjs
//@filename: react.d.ts
+//@filename: app.tsx
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _inherits from "@swc/helpers/src/_inherits.mjs";
import _create_super from "@swc/helpers/src/_create_super.mjs";
-//@filename: app.tsx
import * as React from "react";
+// Should see var button_1 = require('./button') here
+import { Button } from "./button";
export var App = /*#__PURE__*/ function(_Component) {
"use strict";
_inherits(App, _Component);
@@ -21,6 +23,9 @@ export var App = /*#__PURE__*/ function(_Component) {
return App;
}(React.Component);
//@filename: button.tsx
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
import * as React from "react";
export var Button = /*#__PURE__*/ function(_Component) {
"use strict";
diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es5.2.minified.js
index e71bcf818938..3b58a6f66122 100644
--- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit1_es5.2.minified.js
@@ -2,6 +2,7 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _inherits from "@swc/helpers/src/_inherits.mjs";
import _create_super from "@swc/helpers/src/_create_super.mjs";
import * as React from "react";
+import { Button } from "./button";
export var App = function(_Component) {
"use strict";
_inherits(App, _Component);
@@ -13,6 +14,9 @@ export var App = function(_Component) {
return React.createElement(Button, null);
}, App;
}(React.Component);
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+import _inherits from "@swc/helpers/src/_inherits.mjs";
+import _create_super from "@swc/helpers/src/_create_super.mjs";
import * as React from "react";
export var Button = function(_Component) {
"use strict";
diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit2_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit2_es2015.1.normal.js
index 24f23d657e27..7ab8f592197d 100644
--- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit2_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit2_es2015.1.normal.js
@@ -1,8 +1,8 @@
//@jsx: react
//@module: commonjs
//@filename: modules.d.ts
-import _extends from "@swc/helpers/src/_extends.mjs";
//@filename: app.tsx
+import _extends from "@swc/helpers/src/_extends.mjs";
import Main from 'mod';
// Should see mod_1['default'] in emit here
/*#__PURE__*/ React.createElement(Foo, {
diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit2_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit2_es5.1.normal.js
index fe6271641a78..6be5de59e120 100644
--- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit2_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit2_es5.1.normal.js
@@ -1,8 +1,8 @@
//@jsx: react
//@module: commonjs
//@filename: modules.d.ts
-import _extends from "@swc/helpers/src/_extends.mjs";
//@filename: app.tsx
+import _extends from "@swc/helpers/src/_extends.mjs";
import Main from "mod";
// Should see mod_1['default'] in emit here
/*#__PURE__*/ React.createElement(Foo, {
diff --git a/crates/swc/tests/tsc-references/tsxPreserveEmit1_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxPreserveEmit1_es2015.1.normal.js
index 79d739a1adb5..4641eb3602f8 100644
--- a/crates/swc/tests/tsc-references/tsxPreserveEmit1_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxPreserveEmit1_es2015.1.normal.js
@@ -2,6 +2,22 @@
//@jsx: preserve
//@target: ES5
//@Filename: react.d.ts
+//!
+//! x multiple `export =` found
+//! ,-[4:5]
+//! 4 | export = x;
+//! : ^^^^^|^^^^^
+//! : `-- previous `export =` declared here
+//! 5 | }
+//! 6 |
+//! 7 | declare module ReactRouter {
+//! 8 | var Route: any;
+//! 9 | interface Thing { }
+//! 10 | }
+//! 11 | declare module 'react-router' {
+//! 12 | export = ReactRouter;
+//! : ^^^^^^^^^^^^^^^^^^^^^
+//! `----
//@Filename: test.tsx
// Should emit 'react-router' in the AMD dependency list
const React = require('react');
diff --git a/crates/swc/tests/tsc-references/tsxPreserveEmit1_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxPreserveEmit1_es2015.2.minified.js
index b70b42ee25ed..4d2d550fb8e8 100644
--- a/crates/swc/tests/tsc-references/tsxPreserveEmit1_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxPreserveEmit1_es2015.2.minified.js
@@ -1,3 +1,20 @@
+//@Filename: react.d.ts
+//!
+//! x multiple `export =` found
+//! ,-[4:5]
+//! 4 | export = x;
+//! : ^^^^^|^^^^^
+//! : `-- previous `export =` declared here
+//! 5 | }
+//! 6 |
+//! 7 | declare module ReactRouter {
+//! 8 | var Route: any;
+//! 9 | interface Thing { }
+//! 10 | }
+//! 11 | declare module 'react-router' {
+//! 12 | export = ReactRouter;
+//! : ^^^^^^^^^^^^^^^^^^^^^
+//! `----
var M;
require('react');
let ReactRouter = require('react-router');
diff --git a/crates/swc/tests/tsc-references/tsxPreserveEmit1_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxPreserveEmit1_es5.1.normal.js
index f9b5d970d36c..e18a57e7e505 100644
--- a/crates/swc/tests/tsc-references/tsxPreserveEmit1_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxPreserveEmit1_es5.1.normal.js
@@ -2,6 +2,22 @@
//@jsx: preserve
//@target: ES5
//@Filename: react.d.ts
+//!
+//! x multiple `export =` found
+//! ,-[4:5]
+//! 4 | export = x;
+//! : ^^^^^|^^^^^
+//! : `-- previous `export =` declared here
+//! 5 | }
+//! 6 |
+//! 7 | declare module ReactRouter {
+//! 8 | var Route: any;
+//! 9 | interface Thing { }
+//! 10 | }
+//! 11 | declare module 'react-router' {
+//! 12 | export = ReactRouter;
+//! : ^^^^^^^^^^^^^^^^^^^^^
+//! `----
//@Filename: test.tsx
// Should emit 'react-router' in the AMD dependency list
var React = require("react");
diff --git a/crates/swc/tests/tsc-references/tsxPreserveEmit1_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxPreserveEmit1_es5.2.minified.js
index 760789b17afc..c39fba23939a 100644
--- a/crates/swc/tests/tsc-references/tsxPreserveEmit1_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxPreserveEmit1_es5.2.minified.js
@@ -1,3 +1,20 @@
+//@Filename: react.d.ts
+//!
+//! x multiple `export =` found
+//! ,-[4:5]
+//! 4 | export = x;
+//! : ^^^^^|^^^^^
+//! : `-- previous `export =` declared here
+//! 5 | }
+//! 6 |
+//! 7 | declare module ReactRouter {
+//! 8 | var Route: any;
+//! 9 | interface Thing { }
+//! 10 | }
+//! 11 | declare module 'react-router' {
+//! 12 | export = ReactRouter;
+//! : ^^^^^^^^^^^^^^^^^^^^^
+//! `----
var M;
require("react"), require("react-router").Route, function(M) {
var X1;
diff --git a/crates/swc/tests/tsc-references/tsxReactEmit5_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxReactEmit5_es2015.1.normal.js
index 32bad21e5680..33cfb6b27781 100644
--- a/crates/swc/tests/tsc-references/tsxReactEmit5_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxReactEmit5_es2015.1.normal.js
@@ -1,10 +1,10 @@
//@jsx: react
//@module: commonjs
//@filename: file.tsx
-import _extends from "@swc/helpers/src/_extends.mjs";
//@filename: test.d.ts
export var React;
//@filename: react-consumer.tsx
+import _extends from "@swc/helpers/src/_extends.mjs";
import { React } from "./test";
// Should emit test_1.React.createElement
// and React.__spread
diff --git a/crates/swc/tests/tsc-references/tsxReactEmit5_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxReactEmit5_es2015.2.minified.js
index 97a54ed52f79..0e8c788e11fd 100644
--- a/crates/swc/tests/tsc-references/tsxReactEmit5_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxReactEmit5_es2015.2.minified.js
@@ -1,6 +1,6 @@
+export var React;
var foo;
import _extends from "@swc/helpers/src/_extends.mjs";
-export var React;
import { React } from "./test";
_extends({
x: ""
diff --git a/crates/swc/tests/tsc-references/tsxReactEmit5_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxReactEmit5_es5.1.normal.js
index 32bad21e5680..33cfb6b27781 100644
--- a/crates/swc/tests/tsc-references/tsxReactEmit5_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxReactEmit5_es5.1.normal.js
@@ -1,10 +1,10 @@
//@jsx: react
//@module: commonjs
//@filename: file.tsx
-import _extends from "@swc/helpers/src/_extends.mjs";
//@filename: test.d.ts
export var React;
//@filename: react-consumer.tsx
+import _extends from "@swc/helpers/src/_extends.mjs";
import { React } from "./test";
// Should emit test_1.React.createElement
// and React.__spread
diff --git a/crates/swc/tests/tsc-references/tsxReactEmit5_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxReactEmit5_es5.2.minified.js
index 97a54ed52f79..0e8c788e11fd 100644
--- a/crates/swc/tests/tsc-references/tsxReactEmit5_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxReactEmit5_es5.2.minified.js
@@ -1,6 +1,6 @@
+export var React;
var foo;
import _extends from "@swc/helpers/src/_extends.mjs";
-export var React;
import { React } from "./test";
_extends({
x: ""
diff --git a/crates/swc/tests/tsc-references/tsxReactEmit6_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxReactEmit6_es2015.1.normal.js
index 627ded8fae81..b726b6c8d165 100644
--- a/crates/swc/tests/tsc-references/tsxReactEmit6_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxReactEmit6_es2015.1.normal.js
@@ -1,8 +1,8 @@
//@jsx: react
//@module: commonjs
//@filename: file.tsx
-import _extends from "@swc/helpers/src/_extends.mjs";
//@filename: react-consumer.tsx
+import _extends from "@swc/helpers/src/_extends.mjs";
var M;
(function(M) {
var React1;
diff --git a/crates/swc/tests/tsc-references/tsxReactEmit6_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxReactEmit6_es5.1.normal.js
index 627ded8fae81..b726b6c8d165 100644
--- a/crates/swc/tests/tsc-references/tsxReactEmit6_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxReactEmit6_es5.1.normal.js
@@ -1,8 +1,8 @@
//@jsx: react
//@module: commonjs
//@filename: file.tsx
-import _extends from "@swc/helpers/src/_extends.mjs";
//@filename: react-consumer.tsx
+import _extends from "@swc/helpers/src/_extends.mjs";
var M;
(function(M) {
var React1;
diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es2015.1.normal.js
index 009631ea3553..8ffce5047b9e 100644
--- a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es2015.1.normal.js
@@ -1,15 +1,12 @@
-// @jsx: react,react-jsx
-// @target: es2015,es5
-import _extends from "@swc/helpers/src/_extends.mjs";
-function Todo(prop) {
- return /*#__PURE__*/ React.createElement("div", null, prop.key.toString() + prop.todo);
-}
-function TodoList({ todos }) {
- return /*#__PURE__*/ React.createElement("div", null);
-}
-function TodoListNoError({ todos }) {
- // any is not checked
- return /*#__PURE__*/ React.createElement("div", null);
-}
-let x;
-/*#__PURE__*/ React.createElement(TodoList, _extends({}, x));
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 23 | {...}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 29 | {...( as any)}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es2015.2.minified.js
index bfe2ed9d4834..8ffce5047b9e 100644
--- a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es2015.2.minified.js
@@ -1,2 +1,12 @@
-import _extends from "@swc/helpers/src/_extends.mjs";
-_extends({}, void 0);
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 23 | {...}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 29 | {...( as any)}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es5.1.normal.js
index 6aad14ef176b..8ffce5047b9e 100644
--- a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es5.1.normal.js
@@ -1,17 +1,12 @@
-// @jsx: react,react-jsx
-// @target: es2015,es5
-import _extends from "@swc/helpers/src/_extends.mjs";
-function Todo(prop) {
- return /*#__PURE__*/ React.createElement("div", null, prop.key.toString() + prop.todo);
-}
-function TodoList(param) {
- var todos = param.todos;
- return /*#__PURE__*/ React.createElement("div", null);
-}
-function TodoListNoError(param) {
- var todos = param.todos;
- // any is not checked
- return /*#__PURE__*/ React.createElement("div", null);
-}
-var x;
-/*#__PURE__*/ React.createElement(TodoList, _extends({}, x));
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 23 | {...}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 29 | {...( as any)}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es5.2.minified.js
index 65b51afa4ce2..8ffce5047b9e 100644
--- a/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxSpreadChildrenInvalidType_es5.2.minified.js
@@ -1,3 +1,12 @@
-var x;
-import _extends from "@swc/helpers/src/_extends.mjs";
-_extends({}, x);
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 23 | {...}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 29 | {...( as any)}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildren_es2015.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadChildren_es2015.1.normal.js
index 499659c76b9b..2f16978a0430 100644
--- a/crates/swc/tests/tsc-references/tsxSpreadChildren_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxSpreadChildren_es2015.1.normal.js
@@ -1,10 +1,6 @@
-//@jsx: preserve
-import _extends from "@swc/helpers/src/_extends.mjs";
-function Todo(prop) {
- return /*#__PURE__*/ React.createElement("div", null, prop.key.toString() + prop.todo);
-}
-function TodoList({ todos }) {
- return /*#__PURE__*/ React.createElement("div", null);
-}
-let x;
-/*#__PURE__*/ React.createElement(TodoList, _extends({}, x));
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 23 | {...todos.map(todo => )}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildren_es2015.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadChildren_es2015.2.minified.js
index bfe2ed9d4834..2f16978a0430 100644
--- a/crates/swc/tests/tsc-references/tsxSpreadChildren_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxSpreadChildren_es2015.2.minified.js
@@ -1,2 +1,6 @@
-import _extends from "@swc/helpers/src/_extends.mjs";
-_extends({}, void 0);
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 23 | {...todos.map(todo => )}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildren_es5.1.normal.js b/crates/swc/tests/tsc-references/tsxSpreadChildren_es5.1.normal.js
index 31c6b4bb6ce7..2f16978a0430 100644
--- a/crates/swc/tests/tsc-references/tsxSpreadChildren_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/tsxSpreadChildren_es5.1.normal.js
@@ -1,11 +1,6 @@
-//@jsx: preserve
-import _extends from "@swc/helpers/src/_extends.mjs";
-function Todo(prop) {
- return /*#__PURE__*/ React.createElement("div", null, prop.key.toString() + prop.todo);
-}
-function TodoList(param) {
- var todos = param.todos;
- return /*#__PURE__*/ React.createElement("div", null);
-}
-var x;
-/*#__PURE__*/ React.createElement(TodoList, _extends({}, x));
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 23 | {...todos.map(todo => )}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/tsxSpreadChildren_es5.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadChildren_es5.2.minified.js
index 65b51afa4ce2..2f16978a0430 100644
--- a/crates/swc/tests/tsc-references/tsxSpreadChildren_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/tsxSpreadChildren_es5.2.minified.js
@@ -1,3 +1,6 @@
-var x;
-import _extends from "@swc/helpers/src/_extends.mjs";
-_extends({}, x);
+//!
+//! x Spread children are not supported in React.
+//! ,----
+//! 23 | {...todos.map(todo => )}
+//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+//! `----
diff --git a/crates/swc/tests/tsc-references/typeFromParamTagForFunction_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromParamTagForFunction_es2015.2.minified.js
index cf07152215e5..249df184b4b9 100644
--- a/crates/swc/tests/tsc-references/typeFromParamTagForFunction_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromParamTagForFunction_es2015.2.minified.js
@@ -1,24 +1,24 @@
exports.A = function() {
this.x = 1;
};
-let { A } = require("./a-ext");
+const { A } = require("./a-ext");
exports.B = class {
constructor(){
this.x = 1;
}
};
-let { B } = require("./b-ext");
+const { B } = require("./b-ext");
export function C() {
this.x = 1;
}
-let { C } = require("./c-ext");
+const { C } = require("./c-ext");
export var D = function() {
this.x = 1;
};
-let { D } = require("./d-ext");
+const { D } = require("./d-ext");
export class E {
constructor(){
this.x = 1;
}
}
-let { E } = require("./e-ext");
+const { E } = require("./e-ext");
diff --git a/crates/swc/tests/tsc-references/typeFromParamTagForFunction_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromParamTagForFunction_es5.1.normal.js
index 6f2d7449be85..bd87e228eabf 100644
--- a/crates/swc/tests/tsc-references/typeFromParamTagForFunction_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromParamTagForFunction_es5.1.normal.js
@@ -3,7 +3,6 @@
// @noEmit: true
// @module: commonjs
// @filename: node.d.ts
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
// @filename: a-ext.js
exports.A = function() {
this.x = 1;
@@ -14,6 +13,7 @@ var A = require("./a-ext").A;
p.x;
}
// @filename: b-ext.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
exports.B = function _class() {
"use strict";
_class_call_check(this, _class);
@@ -43,6 +43,7 @@ var D = require("./d-ext").D;
p.x;
}
// @filename: e-ext.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var E = function E() {
"use strict";
_class_call_check(this, E);
@@ -68,6 +69,7 @@ function G() {
p.x;
}
// @filename: h.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var H = function H() {
"use strict";
_class_call_check(this, H);
diff --git a/crates/swc/tests/tsc-references/typeFromParamTagForFunction_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromParamTagForFunction_es5.2.minified.js
index d27b6b9232ba..37e428525fc6 100644
--- a/crates/swc/tests/tsc-references/typeFromParamTagForFunction_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromParamTagForFunction_es5.2.minified.js
@@ -1,10 +1,13 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
exports.A = function() {
this.x = 1;
-}, require("./a-ext").A, exports.B = function _class() {
+};
+require("./a-ext").A;
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+exports.B = function _class() {
"use strict";
_class_call_check(this, _class), this.x = 1;
-}, require("./b-ext").B;
+};
+require("./b-ext").B;
export function C() {
this.x = 1;
}
@@ -13,11 +16,14 @@ export var D = function() {
this.x = 1;
};
require("./d-ext").D;
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
export var E = function() {
"use strict";
_class_call_check(this, E), this.x = 1;
};
-var E = require("./e-ext").E, H = function() {
+require("./e-ext").E;
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+var H = function() {
"use strict";
_class_call_check(this, H), this.x = 1;
};
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es2015.2.minified.js
index c9a2e2d4d010..b1fb15ce42fc 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es2015.2.minified.js
@@ -1,11 +1,15 @@
-var _app, x, Outer = null != Outer ? Outer : {};
-Outer.app = null !== (_app = Outer.app) && void 0 !== _app ? _app : {}, Outer.app.SomeView = function() {}, Outer.app.Inner = class {
+var _app, Outer = null != Outer ? Outer : {};
+Outer.app = null !== (_app = Outer.app) && void 0 !== _app ? _app : {};
+Outer.app.SomeView = function() {}, Outer.app.Inner = class {
constructor(){
this.y = 12;
}
}, new Outer.app.Inner().y, Outer.app.statische = function(k) {
return Math.pow(k, k);
-}, Outer.app.Application = function() {
+};
+Outer.app.Application = function() {
var me = this;
me.view = new Outer.app.SomeView();
-}, new Outer.app.Application(), new Outer.app.Inner().y, x.y, Outer.app.statische(101);
+};
+var x;
+new Outer.app.Application(), new Outer.app.Inner().y, x.y, Outer.app.statische(101);
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.1.normal.js
index e320fae681e6..dd8905f44fe4 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.1.normal.js
@@ -3,11 +3,11 @@
// @checkJs: true
// @target: esnext
// @Filename: module.js
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Outer = Outer !== null && Outer !== void 0 ? Outer : {};
var _app;
Outer.app = (_app = Outer.app) !== null && _app !== void 0 ? _app : {};
// @Filename: someview.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
Outer.app.SomeView = function() {
var SomeView = function SomeView() {
var me = this;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.2.minified.js
index 153635f72657..1d5c95fce7df 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_1_es5.2.minified.js
@@ -1,11 +1,15 @@
+var _app, Outer = null != Outer ? Outer : {};
+Outer.app = null !== (_app = Outer.app) && void 0 !== _app ? _app : {};
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var _app, x, Outer = null != Outer ? Outer : {};
-Outer.app = null !== (_app = Outer.app) && void 0 !== _app ? _app : {}, Outer.app.SomeView = function() {}, Outer.app.Inner = function _class() {
+Outer.app.SomeView = function() {}, Outer.app.Inner = function _class() {
"use strict";
_class_call_check(this, _class), this.y = 12;
}, new Outer.app.Inner().y, Outer.app.statische = function(k) {
return Math.pow(k, k);
-}, Outer.app.Application = function() {
+};
+Outer.app.Application = function() {
var me = this;
me.view = new Outer.app.SomeView();
-}, new Outer.app.Application(), new Outer.app.Inner().y, x.y, Outer.app.statische(101);
+};
+var x;
+new Outer.app.Application(), new Outer.app.Inner().y, x.y, Outer.app.statische(101);
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es2015.2.minified.js
index 20c8fcbfc2ed..fd04ac07f2e6 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es2015.2.minified.js
@@ -1,11 +1,15 @@
-var x, Outer = Outer || {};
-Outer.app = Outer.app || {}, Outer.app.SomeView = function() {}, Outer.app.Inner = class {
+var Outer = Outer || {};
+Outer.app = Outer.app || {};
+Outer.app.SomeView = function() {}, Outer.app.Inner = class {
constructor(){
this.y = 12;
}
}, new Outer.app.Inner().y, Outer.app.statische = function(k) {
return Math.pow(k, k);
-}, Outer.app.Application = function() {
+};
+Outer.app.Application = function() {
var me = this;
me.view = new Outer.app.SomeView();
-}, new Outer.app.Application(), new Outer.app.Inner().y, x.y, Outer.app.statische(101);
+};
+var x;
+new Outer.app.Application(), new Outer.app.Inner().y, x.y, Outer.app.statische(101);
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.1.normal.js
index 3af8c7314e12..4b5113bee4ef 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.1.normal.js
@@ -3,10 +3,10 @@
// @checkJs: true
// @target: es6
// @Filename: module.js
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Outer = Outer || {};
Outer.app = Outer.app || {};
// @Filename: someview.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
Outer.app.SomeView = function() {
var SomeView = function SomeView() {
var me = this;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.2.minified.js
index 8b2dae07406d..d3146bde1d3b 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment10_es5.2.minified.js
@@ -1,11 +1,15 @@
+var Outer = Outer || {};
+Outer.app = Outer.app || {};
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var x, Outer = Outer || {};
-Outer.app = Outer.app || {}, Outer.app.SomeView = function() {}, Outer.app.Inner = function _class() {
+Outer.app.SomeView = function() {}, Outer.app.Inner = function _class() {
"use strict";
_class_call_check(this, _class), this.y = 12;
}, new Outer.app.Inner().y, Outer.app.statische = function(k) {
return Math.pow(k, k);
-}, Outer.app.Application = function() {
+};
+Outer.app.Application = function() {
var me = this;
me.view = new Outer.app.SomeView();
-}, new Outer.app.Application(), new Outer.app.Inner().y, x.y, Outer.app.statische(101);
+};
+var x;
+new Outer.app.Application(), new Outer.app.Inner().y, x.y, Outer.app.statische(101);
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es2015.2.minified.js
index 80461d3308b5..da1f9d62b110 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es2015.2.minified.js
@@ -1,2 +1 @@
-var Outer = function(element, config) {};
Outer.Pos = function(line, ch) {}, Outer.Pos.prototype.line, new Outer.Pos(1, 'x').line;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es5.2.minified.js
index b257288318cb..45f8e37e9998 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment12_es5.2.minified.js
@@ -1,2 +1 @@
-var Outer = function(element, config) {};
Outer.Pos = function(line, ch) {}, Outer.Pos.prototype.line, new Outer.Pos(1, "x").line;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es2015.2.minified.js
index 40ab0b0d323b..468800c5c1a2 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es2015.2.minified.js
@@ -1,7 +1,7 @@
-var inner, Outer = {};
Outer.Inner = function() {}, Outer.Inner.prototype = {
x: 1,
m () {}
-}, inner.x, inner.m();
-var inno = new Outer.Inner();
+};
+inner.x, inner.m();
+var inner, inno = new Outer.Inner();
inno.x, inno.m();
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es5.2.minified.js
index 0b9e16e01642..f7c0addf4982 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment14_es5.2.minified.js
@@ -1,7 +1,7 @@
-var inner, Outer = {};
Outer.Inner = function() {}, Outer.Inner.prototype = {
x: 1,
m: function() {}
-}, inner.x, inner.m();
-var inno = new Outer.Inner();
+};
+inner.x, inner.m();
+var inner, inno = new Outer.Inner();
inno.x, inno.m();
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment19_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment19_es5.2.minified.js
index aaaf6bb6c040..a14b6753ed5f 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment19_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment19_es5.2.minified.js
@@ -4,5 +4,4 @@ function C() {
exports = module.exports = C, C.f = function(n) {
return n + 1;
};
-var C = require("./semver");
-C.f(1);
+require("./semver").f(1);
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es2015.2.minified.js
index 6eb44bc51f94..3a5120ba4f83 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es2015.2.minified.js
@@ -1,6 +1,6 @@
+var x;
Outer.Inner.Message = function() {}, new Outer.Inner().name, x.name;
-var x, Outer = {};
-Outer.Inner = class {
+({}).Inner = class {
name() {
return 'hi';
}
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.1.normal.js
index 03c9f7dd438f..eb45073d4013 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.1.normal.js
@@ -3,13 +3,13 @@
// @allowJs: true
// @Filename: usage.js
// note that usage is first in the compilation
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
Outer.Inner.Message = function() {};
var y = new Outer.Inner();
y.name;
/** @type {Outer.Inner} should be instance type, not static type */ var x;
x.name;
// @Filename: def.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Outer = {};
Outer.Inner = /*#__PURE__*/ function() {
"use strict";
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.2.minified.js
index 5c0b30731ab7..8d7e9bf37cc8 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment24_es5.2.minified.js
@@ -1,7 +1,7 @@
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+var x;
Outer.Inner.Message = function() {}, new Outer.Inner().name, x.name;
-var x, Outer = {};
-Outer.Inner = function() {
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+({}).Inner = function() {
"use strict";
function _class() {
_class_call_check(this, _class);
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.1.normal.js
index 9df0a4c70b13..95c34e6a0366 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.1.normal.js
@@ -13,6 +13,8 @@ ExpandoMerge.p7 = 777777;
ExpandoMerge.p8 = false; // type error
ExpandoMerge.p9 = false; // type error
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
+// @Filename: ns.ts
+var ExpandoMerge;
(function(ExpandoMerge) {
var p3 = ExpandoMerge.p3 = 333;
var p4 = ExpandoMerge.p4 = 4;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.2.minified.js
index 5ed08c9d2cc9..4026a2d51890 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es2015.2.minified.js
@@ -3,6 +3,8 @@ function ExpandoMerge(n) {
}
ExpandoMerge.p1 = 111, ExpandoMerge.m = function(n) {
return n + 1;
-}, ExpandoMerge.p4 = 44444, ExpandoMerge.p5 = 555555, ExpandoMerge.p6 = 66666, ExpandoMerge.p7 = 777777, ExpandoMerge.p8 = !1, ExpandoMerge.p9 = !1, ExpandoMerge.p1, ExpandoMerge.p2, ExpandoMerge.p3, ExpandoMerge.p4, ExpandoMerge.p5, ExpandoMerge.p6, ExpandoMerge.p7, ExpandoMerge.p8, ExpandoMerge.p9, ExpandoMerge.m(12), ExpandoMerge(1001), function(ExpandoMerge) {
+}, ExpandoMerge.p4 = 44444, ExpandoMerge.p5 = 555555, ExpandoMerge.p6 = 66666, ExpandoMerge.p7 = 777777, ExpandoMerge.p8 = !1, ExpandoMerge.p9 = !1, ExpandoMerge.p1, ExpandoMerge.p2, ExpandoMerge.p3, ExpandoMerge.p4, ExpandoMerge.p5, ExpandoMerge.p6, ExpandoMerge.p7, ExpandoMerge.p8, ExpandoMerge.p9, ExpandoMerge.m(12);
+var ExpandoMerge;
+!function(ExpandoMerge) {
ExpandoMerge.p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7;
}(ExpandoMerge || (ExpandoMerge = {})), (ExpandoMerge || (ExpandoMerge = {})).p2 = 222;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.1.normal.js
index 9df0a4c70b13..95c34e6a0366 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.1.normal.js
@@ -13,6 +13,8 @@ ExpandoMerge.p7 = 777777;
ExpandoMerge.p8 = false; // type error
ExpandoMerge.p9 = false; // type error
var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001);
+// @Filename: ns.ts
+var ExpandoMerge;
(function(ExpandoMerge) {
var p3 = ExpandoMerge.p3 = 333;
var p4 = ExpandoMerge.p4 = 4;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.2.minified.js
index 5ed08c9d2cc9..4026a2d51890 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment32_es5.2.minified.js
@@ -3,6 +3,8 @@ function ExpandoMerge(n) {
}
ExpandoMerge.p1 = 111, ExpandoMerge.m = function(n) {
return n + 1;
-}, ExpandoMerge.p4 = 44444, ExpandoMerge.p5 = 555555, ExpandoMerge.p6 = 66666, ExpandoMerge.p7 = 777777, ExpandoMerge.p8 = !1, ExpandoMerge.p9 = !1, ExpandoMerge.p1, ExpandoMerge.p2, ExpandoMerge.p3, ExpandoMerge.p4, ExpandoMerge.p5, ExpandoMerge.p6, ExpandoMerge.p7, ExpandoMerge.p8, ExpandoMerge.p9, ExpandoMerge.m(12), ExpandoMerge(1001), function(ExpandoMerge) {
+}, ExpandoMerge.p4 = 44444, ExpandoMerge.p5 = 555555, ExpandoMerge.p6 = 66666, ExpandoMerge.p7 = 777777, ExpandoMerge.p8 = !1, ExpandoMerge.p9 = !1, ExpandoMerge.p1, ExpandoMerge.p2, ExpandoMerge.p3, ExpandoMerge.p4, ExpandoMerge.p5, ExpandoMerge.p6, ExpandoMerge.p7, ExpandoMerge.p8, ExpandoMerge.p9, ExpandoMerge.m(12);
+var ExpandoMerge;
+!function(ExpandoMerge) {
ExpandoMerge.p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7;
}(ExpandoMerge || (ExpandoMerge = {})), (ExpandoMerge || (ExpandoMerge = {})).p2 = 222;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.1.normal.js
index 5e1c7ef582ab..23ccd0fcd061 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.1.normal.js
@@ -1,4 +1,5 @@
// @Filename: ns.ts
+var ExpandoMerge;
(function(ExpandoMerge) {
var p3 = ExpandoMerge.p3 = 333;
var p4 = ExpandoMerge.p4 = 4;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.2.minified.js
index 8ed5188c8e39..7c9b9d7c75ca 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es2015.2.minified.js
@@ -1,8 +1,10 @@
+var ExpandoMerge;
+!function(ExpandoMerge) {
+ ExpandoMerge.p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7;
+}(ExpandoMerge || (ExpandoMerge = {})), (ExpandoMerge || (ExpandoMerge = {})).p2 = 222;
function ExpandoMerge(n) {
return n;
}
-!function(ExpandoMerge) {
- ExpandoMerge.p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7;
-}(ExpandoMerge || (ExpandoMerge = {})), (ExpandoMerge || (ExpandoMerge = {})).p2 = 222, ExpandoMerge.p1 = 111, ExpandoMerge.m = function(n) {
+ExpandoMerge.p1 = 111, ExpandoMerge.m = function(n) {
return n + 1;
-}, ExpandoMerge.p4 = 44444, ExpandoMerge.p5 = 555555, ExpandoMerge.p6 = 66666, ExpandoMerge.p7 = 777777, ExpandoMerge.p8 = !1, ExpandoMerge.p9 = !1, ExpandoMerge.p1, ExpandoMerge.p2, ExpandoMerge.p3, ExpandoMerge.p4, ExpandoMerge.p5, ExpandoMerge.p6, ExpandoMerge.p7, ExpandoMerge.p8, ExpandoMerge.p9, ExpandoMerge.m(12), ExpandoMerge(1001);
+}, ExpandoMerge.p4 = 44444, ExpandoMerge.p5 = 555555, ExpandoMerge.p6 = 66666, ExpandoMerge.p7 = 777777, ExpandoMerge.p8 = !1, ExpandoMerge.p9 = !1, ExpandoMerge.p1, ExpandoMerge.p2, ExpandoMerge.p3, ExpandoMerge.p4, ExpandoMerge.p5, ExpandoMerge.p6, ExpandoMerge.p7, ExpandoMerge.p8, ExpandoMerge.p9, ExpandoMerge.m(12);
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.1.normal.js
index 5e1c7ef582ab..23ccd0fcd061 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.1.normal.js
@@ -1,4 +1,5 @@
// @Filename: ns.ts
+var ExpandoMerge;
(function(ExpandoMerge) {
var p3 = ExpandoMerge.p3 = 333;
var p4 = ExpandoMerge.p4 = 4;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.2.minified.js
index 8ed5188c8e39..7c9b9d7c75ca 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment33_es5.2.minified.js
@@ -1,8 +1,10 @@
+var ExpandoMerge;
+!function(ExpandoMerge) {
+ ExpandoMerge.p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7;
+}(ExpandoMerge || (ExpandoMerge = {})), (ExpandoMerge || (ExpandoMerge = {})).p2 = 222;
function ExpandoMerge(n) {
return n;
}
-!function(ExpandoMerge) {
- ExpandoMerge.p3 = 333, ExpandoMerge.p4 = 4, ExpandoMerge.p5 = 5, ExpandoMerge.p6 = 6, ExpandoMerge.p7 = 7, ExpandoMerge.p8 = 6, ExpandoMerge.p9 = 7;
-}(ExpandoMerge || (ExpandoMerge = {})), (ExpandoMerge || (ExpandoMerge = {})).p2 = 222, ExpandoMerge.p1 = 111, ExpandoMerge.m = function(n) {
+ExpandoMerge.p1 = 111, ExpandoMerge.m = function(n) {
return n + 1;
-}, ExpandoMerge.p4 = 44444, ExpandoMerge.p5 = 555555, ExpandoMerge.p6 = 66666, ExpandoMerge.p7 = 777777, ExpandoMerge.p8 = !1, ExpandoMerge.p9 = !1, ExpandoMerge.p1, ExpandoMerge.p2, ExpandoMerge.p3, ExpandoMerge.p4, ExpandoMerge.p5, ExpandoMerge.p6, ExpandoMerge.p7, ExpandoMerge.p8, ExpandoMerge.p9, ExpandoMerge.m(12), ExpandoMerge(1001);
+}, ExpandoMerge.p4 = 44444, ExpandoMerge.p5 = 555555, ExpandoMerge.p6 = 66666, ExpandoMerge.p7 = 777777, ExpandoMerge.p8 = !1, ExpandoMerge.p9 = !1, ExpandoMerge.p1, ExpandoMerge.p2, ExpandoMerge.p3, ExpandoMerge.p4, ExpandoMerge.p5, ExpandoMerge.p6, ExpandoMerge.p7, ExpandoMerge.p8, ExpandoMerge.p9, ExpandoMerge.m(12);
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es2015.2.minified.js
index b116e6a03a0b..dca6716f4fce 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es2015.2.minified.js
@@ -1,2 +1,2 @@
-var N = {};
-N.commands = {}, N.commands.a = 111, N.commands.b = function() {};
+({}).commands = {};
+N.commands.a = 111, N.commands.b = function() {};
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es5.2.minified.js
index b116e6a03a0b..dca6716f4fce 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment34_es5.2.minified.js
@@ -1,2 +1,2 @@
-var N = {};
-N.commands = {}, N.commands.a = 111, N.commands.b = function() {};
+({}).commands = {};
+N.commands.a = 111, N.commands.b = function() {};
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es2015.2.minified.js
index 92c27e0ddfd3..c85f3d781281 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es2015.2.minified.js
@@ -3,5 +3,4 @@ Emu.D = class {
this._model = 1;
}
};
-var Emu = {};
-Emu.D._wrapperInstance;
+({}).D._wrapperInstance;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es5.2.minified.js
index b2790c599b11..4fae47e1be8c 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment35_es5.2.minified.js
@@ -3,5 +3,4 @@ Emu.D = function _class() {
"use strict";
_class_call_check(this, _class), this._model = 1;
};
-var Emu = {};
-Emu.D._wrapperInstance;
+({}).D._wrapperInstance;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es2015.2.minified.js
index ab296a3bc0ab..1095a570d6cf 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es2015.2.minified.js
@@ -1,2 +1,3 @@
-const util = exports = module.exports = {}, util = require('./mod');
+exports = module.exports = {};
+const util = require('./mod');
util.existy;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es5.2.minified.js
index 848fb87920f2..7f9fc23d5f2c 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment37_es5.2.minified.js
@@ -1 +1,2 @@
-(exports = module.exports = {}, require("./mod")).existy;
+exports = module.exports = {};
+require("./mod").existy;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es2015.2.minified.js
index 57c9b332ff31..46c87b147a39 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es2015.2.minified.js
@@ -1,6 +1,7 @@
-var local, x, Outer = {};
+var local;
Outer.Inner = class {
constructor(){
this.y = 12;
}
-}, local.y, new Outer.Inner().y, x.y, new Outer.Inner().y;
+}, local.y, new Outer.Inner().y;
+(void 0).y, new Outer.Inner().y;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.1.normal.js
index a911fee831f0..4131af89241b 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.1.normal.js
@@ -2,9 +2,9 @@
// @allowJs: true
// @checkJs: true
// @Filename: def.js
-import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Outer = {};
// @Filename: a.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
Outer.Inner = function _class() {
"use strict";
_class_call_check(this, _class);
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.2.minified.js
index ee4a5240d5f3..e708d1303d6e 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment4_es5.2.minified.js
@@ -1,6 +1,7 @@
+var local;
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
-var local, x, Outer = {};
Outer.Inner = function _class() {
"use strict";
_class_call_check(this, _class), this.y = 12;
-}, local.y, new Outer.Inner().y, x.y, new Outer.Inner().y;
+}, local.y, new Outer.Inner().y;
+(void 0).y, new Outer.Inner().y;
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es2015.2.minified.js
index dd47f3f0dc76..00540eb39105 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es2015.2.minified.js
@@ -1,7 +1,6 @@
-class Outer {
-}
Outer.Inner = class {
messages() {
return [];
}
-}, Outer.i, Outer.i.messages();
+}, Outer.i;
+Outer.i.messages();
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es5.1.normal.js
index 4878eea8bb22..119a02be4554 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es5.1.normal.js
@@ -9,6 +9,7 @@ var Outer = function Outer() {
_class_call_check(this, Outer);
};
// @Filename: a.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
Outer.Inner = /*#__PURE__*/ function() {
"use strict";
function I() {
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es5.2.minified.js
index 93368d3cff97..6995b21cde7c 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment6_es5.2.minified.js
@@ -3,6 +3,7 @@ var Outer = function() {
"use strict";
_class_call_check(this, Outer);
};
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
Outer.Inner = function() {
"use strict";
function I() {
@@ -11,4 +12,5 @@ Outer.Inner = function() {
return I.prototype.messages = function() {
return [];
}, I;
-}(), Outer.i, Outer.i.messages();
+}(), Outer.i;
+Outer.i.messages();
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.1.normal.js
index 8c02f747714d..3d3e6aa6c665 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.1.normal.js
@@ -14,11 +14,11 @@ my.app.Application = function() {
return Application;
}();
my.app.Application();
-var _min;
// @Filename: b.js
+var _min;
var min = (_min = window.min) !== null && _min !== void 0 ? _min : {};
-var _app1;
-min.app = (_app1 = min.app) !== null && _app1 !== void 0 ? _app1 : {};
+var _app;
+min.app = (_app = min.app) !== null && _app !== void 0 ? _app : {};
min.app.Application = function() {
var Application = function() {
//...
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.2.minified.js
index ca938d54433a..5ec567055a1f 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es2015.2.minified.js
@@ -1,4 +1,4 @@
-var _app, _min, _app1, my = null != my ? my : {};
+var _app, my = null != my ? my : {};
my.app = null !== (_app = my.app) && void 0 !== _app ? _app : {}, my.app.Application = function() {}, my.app.Application();
-var min = null !== (_min = window.min) && void 0 !== _min ? _min : {};
-min.app = null !== (_app1 = min.app) && void 0 !== _app1 ? _app1 : {}, min.app.Application = function() {}, min.app.Application();
+var _min, _app, min = null !== (_min = window.min) && void 0 !== _min ? _min : {};
+min.app = null !== (_app = min.app) && void 0 !== _app ? _app : {}, min.app.Application = function() {}, min.app.Application();
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.1.normal.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.1.normal.js
index dad8b47b38dd..4233d78cc082 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.1.normal.js
@@ -14,11 +14,11 @@ my.app.Application = function() {
return Application;
}();
my.app.Application();
-var _min;
// @Filename: b.js
+var _min;
var min = (_min = window.min) !== null && _min !== void 0 ? _min : {};
-var _app1;
-min.app = (_app1 = min.app) !== null && _app1 !== void 0 ? _app1 : {};
+var _app;
+min.app = (_app = min.app) !== null && _app !== void 0 ? _app : {};
min.app.Application = function() {
var Application = function Application() {
//...
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.2.minified.js
index ca938d54433a..5ec567055a1f 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignment8_1_es5.2.minified.js
@@ -1,4 +1,4 @@
-var _app, _min, _app1, my = null != my ? my : {};
+var _app, my = null != my ? my : {};
my.app = null !== (_app = my.app) && void 0 !== _app ? _app : {}, my.app.Application = function() {}, my.app.Application();
-var min = null !== (_min = window.min) && void 0 !== _min ? _min : {};
-min.app = null !== (_app1 = min.app) && void 0 !== _app1 ? _app1 : {}, min.app.Application = function() {}, min.app.Application();
+var _min, _app, min = null !== (_min = window.min) && void 0 !== _min ? _min : {};
+min.app = null !== (_app = min.app) && void 0 !== _app ? _app : {}, min.app.Application = function() {}, min.app.Application();
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es2015.2.minified.js
index f40ab2603d89..fa489c579040 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es2015.2.minified.js
@@ -2,4 +2,3 @@ First.Item = class {
}, Common.Object = class extends First.Item {
}, Workspace.Object = class extends Common.Object {
};
-var First = {}, Common = {}, Workspace = {};
diff --git a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es5.2.minified.js b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es5.2.minified.js
index 6a5f33d8b63b..1bbf2b82e351 100644
--- a/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeFromPropertyAssignmentOutOfOrder_es5.2.minified.js
@@ -21,4 +21,3 @@ First.Item = function I() {
}
return _class;
}(Common.Object);
-var First = {}, Common = {}, Workspace = {};
diff --git a/crates/swc/tests/tsc-references/typeQuery_es2015.1.normal.js b/crates/swc/tests/tsc-references/typeQuery_es2015.1.normal.js
index 192be3f4d83d..f4c095e75b44 100644
--- a/crates/swc/tests/tsc-references/typeQuery_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeQuery_es2015.1.normal.js
@@ -1,4 +1,6 @@
// @Filename: /a.ts
export class A {
}
+// @Filename: /b.ts
let AConstructor;
+export { };
diff --git a/crates/swc/tests/tsc-references/typeQuery_es2015.2.minified.js b/crates/swc/tests/tsc-references/typeQuery_es2015.2.minified.js
index 4a17f4af9fc7..95b1242eacaa 100644
--- a/crates/swc/tests/tsc-references/typeQuery_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeQuery_es2015.2.minified.js
@@ -1,2 +1,3 @@
export class A {
}
+export { };
diff --git a/crates/swc/tests/tsc-references/typeQuery_es5.1.normal.js b/crates/swc/tests/tsc-references/typeQuery_es5.1.normal.js
index acee38b574f8..fc32289fd7e0 100644
--- a/crates/swc/tests/tsc-references/typeQuery_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typeQuery_es5.1.normal.js
@@ -4,4 +4,6 @@ export var A = function A() {
"use strict";
_class_call_check(this, A);
};
+// @Filename: /b.ts
var AConstructor;
+export { };
diff --git a/crates/swc/tests/tsc-references/typeQuery_es5.2.minified.js b/crates/swc/tests/tsc-references/typeQuery_es5.2.minified.js
index eed7ca896ebd..6845732041ee 100644
--- a/crates/swc/tests/tsc-references/typeQuery_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typeQuery_es5.2.minified.js
@@ -3,3 +3,4 @@ export var A = function() {
"use strict";
_class_call_check(this, A);
};
+export { };
diff --git a/crates/swc/tests/tsc-references/typedefCrossModule2_es2015.2.minified.js b/crates/swc/tests/tsc-references/typedefCrossModule2_es2015.2.minified.js
index a3d1c76bd8df..905c47fffedd 100644
--- a/crates/swc/tests/tsc-references/typedefCrossModule2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typedefCrossModule2_es2015.2.minified.js
@@ -4,4 +4,5 @@ exports.Bar = class {
}
}, exports.Quid = 2, module.exports = {
Quack: 2
-}, new (require('./mod1.js')).Baz();
+};
+new (require('./mod1.js')).Baz();
diff --git a/crates/swc/tests/tsc-references/typedefCrossModule2_es5.2.minified.js b/crates/swc/tests/tsc-references/typedefCrossModule2_es5.2.minified.js
index 7c8d3dd0d315..9873ccdf84ba 100644
--- a/crates/swc/tests/tsc-references/typedefCrossModule2_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typedefCrossModule2_es5.2.minified.js
@@ -13,4 +13,5 @@ exports.Bar = function _class() {
}
}, exports.Quid = 2, module.exports = {
Quack: 2
-}, new (require("./mod1.js")).Baz();
+};
+new (require("./mod1.js")).Baz();
diff --git a/crates/swc/tests/tsc-references/typedefCrossModule5_es5.1.normal.js b/crates/swc/tests/tsc-references/typedefCrossModule5_es5.1.normal.js
index b153a31657c8..cb4617556a99 100644
--- a/crates/swc/tests/tsc-references/typedefCrossModule5_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typedefCrossModule5_es5.1.normal.js
@@ -9,6 +9,7 @@ var Bar = function Bar() {
_class_call_check(this, Bar);
};
// @Filename: mod2.js
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Foo = function Foo() {
"use strict";
_class_call_check(this, Foo);
diff --git a/crates/swc/tests/tsc-references/typedefCrossModule5_es5.2.minified.js b/crates/swc/tests/tsc-references/typedefCrossModule5_es5.2.minified.js
index e55855dcc566..037458d18602 100644
--- a/crates/swc/tests/tsc-references/typedefCrossModule5_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typedefCrossModule5_es5.2.minified.js
@@ -1,4 +1,9 @@
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
+var Bar = function() {
+ "use strict";
+ _class_call_check(this, Bar);
+};
+import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
var Foo = function() {
"use strict";
_class_call_check(this, Foo);
diff --git a/crates/swc/tests/tsc-references/typedefCrossModule_es2015.2.minified.js b/crates/swc/tests/tsc-references/typedefCrossModule_es2015.2.minified.js
index 38d17eab90e3..c701c4797a1a 100644
--- a/crates/swc/tests/tsc-references/typedefCrossModule_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typedefCrossModule_es2015.2.minified.js
@@ -1,7 +1,6 @@
-function C() {
+module.exports = function() {
this.p = 1;
-}
-module.exports = C;
+};
export function C() {
this.p = 1;
}
diff --git a/crates/swc/tests/tsc-references/typedefCrossModule_es5.2.minified.js b/crates/swc/tests/tsc-references/typedefCrossModule_es5.2.minified.js
index 38d17eab90e3..c701c4797a1a 100644
--- a/crates/swc/tests/tsc-references/typedefCrossModule_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typedefCrossModule_es5.2.minified.js
@@ -1,7 +1,6 @@
-function C() {
+module.exports = function() {
this.p = 1;
-}
-module.exports = C;
+};
export function C() {
this.p = 1;
}
diff --git a/crates/swc/tests/tsc-references/typedefMultipleTypeParameters_es2015.1.normal.js b/crates/swc/tests/tsc-references/typedefMultipleTypeParameters_es2015.1.normal.js
index 16deb6854b72..db8b5c32292a 100644
--- a/crates/swc/tests/tsc-references/typedefMultipleTypeParameters_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/typedefMultipleTypeParameters_es2015.1.normal.js
@@ -11,3 +11,4 @@
*/ /** @type {Everything<{ a: number, b: 'hi', c: never }, undefined, { c: true, d: 1 }, number, string>} */ var tuvwx;
/** @type {Everything<{ a: number }, undefined, { c: 1, d: 1 }, number, string>} */ var wrong;
/** @type {Everything<{ a: number }>} */ var insufficient;
+// @Filename: test.ts
diff --git a/crates/swc/tests/tsc-references/typedefMultipleTypeParameters_es5.1.normal.js b/crates/swc/tests/tsc-references/typedefMultipleTypeParameters_es5.1.normal.js
index 16deb6854b72..db8b5c32292a 100644
--- a/crates/swc/tests/tsc-references/typedefMultipleTypeParameters_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typedefMultipleTypeParameters_es5.1.normal.js
@@ -11,3 +11,4 @@
*/ /** @type {Everything<{ a: number, b: 'hi', c: never }, undefined, { c: true, d: 1 }, number, string>} */ var tuvwx;
/** @type {Everything<{ a: number }, undefined, { c: 1, d: 1 }, number, string>} */ var wrong;
/** @type {Everything<{ a: number }>} */ var insufficient;
+// @Filename: test.ts
diff --git a/crates/swc/tests/tsc-references/typedefTagWrapping_es2015.1.normal.js b/crates/swc/tests/tsc-references/typedefTagWrapping_es2015.1.normal.js
index 40628f3fb1a1..3ce251d682fe 100644
--- a/crates/swc/tests/tsc-references/typedefTagWrapping_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/typedefTagWrapping_es2015.1.normal.js
@@ -92,8 +92,9 @@
* @returns {*} The return.
*/ function check6(obj) {
return obj.foo;
-} // @Filename: mod7.js
- /**
+}
+// @Filename: mod7.js
+/**
Multiline type expressions in comments without leading * are not supported.
@typedef {{
foo:
diff --git a/crates/swc/tests/tsc-references/typedefTagWrapping_es5.1.normal.js b/crates/swc/tests/tsc-references/typedefTagWrapping_es5.1.normal.js
index 40628f3fb1a1..3ce251d682fe 100644
--- a/crates/swc/tests/tsc-references/typedefTagWrapping_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typedefTagWrapping_es5.1.normal.js
@@ -92,8 +92,9 @@
* @returns {*} The return.
*/ function check6(obj) {
return obj.foo;
-} // @Filename: mod7.js
- /**
+}
+// @Filename: mod7.js
+/**
Multiline type expressions in comments without leading * are not supported.
@typedef {{
foo:
diff --git a/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es2015.1.normal.js b/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es2015.1.normal.js
index 4054df914666..4ae710e28db9 100644
--- a/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es2015.1.normal.js
@@ -1,5 +1,6 @@
// @module: commonjs
// @Filename: foo_0.ts
+export { };
// @Filename: foo_1.ts
const foo0 = require('./foo_0');
// Per 11.2.3, foo_0 should still be "instantiated", albeit with no members
diff --git a/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es2015.2.minified.js b/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es2015.2.minified.js
index 51979294a589..85609ef6e71d 100644
--- a/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es2015.2.minified.js
@@ -1,2 +1,3 @@
+export { };
require('./foo_0');
export { };
diff --git a/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es5.1.normal.js b/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es5.1.normal.js
index d8b5fcd88cdb..bb0bdb05e89e 100644
--- a/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es5.1.normal.js
@@ -1,5 +1,6 @@
// @module: commonjs
// @Filename: foo_0.ts
+export { };
// @Filename: foo_1.ts
var foo0 = require("./foo_0");
// Per 11.2.3, foo_0 should still be "instantiated", albeit with no members
diff --git a/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es5.2.minified.js b/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es5.2.minified.js
index dbab3b947607..96afc15ca62b 100644
--- a/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typesOnlyExternalModuleStillHasInstance_es5.2.minified.js
@@ -1,2 +1,3 @@
+export { };
require("./foo_0");
export { };
diff --git a/crates/swc/tests/tsc-references/typingsLookupAmd_es2015.1.normal.js b/crates/swc/tests/tsc-references/typingsLookupAmd_es2015.1.normal.js
index 94e262db9b72..1daa716fcf16 100644
--- a/crates/swc/tests/tsc-references/typingsLookupAmd_es2015.1.normal.js
+++ b/crates/swc/tests/tsc-references/typingsLookupAmd_es2015.1.normal.js
@@ -4,3 +4,7 @@
// @module: amd
// @filename: /node_modules/@types/a/index.d.ts
export { };
+// @filename: /x/node_modules/@types/b/index.d.ts
+import { A } from "a";
+// @filename: /x/y/foo.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/typingsLookupAmd_es2015.2.minified.js b/crates/swc/tests/tsc-references/typingsLookupAmd_es2015.2.minified.js
index 2234b9cae16d..a85d8324c074 100644
--- a/crates/swc/tests/tsc-references/typingsLookupAmd_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/typingsLookupAmd_es2015.2.minified.js
@@ -1 +1,3 @@
export { };
+import { A } from "a";
+export { };
diff --git a/crates/swc/tests/tsc-references/typingsLookupAmd_es5.1.normal.js b/crates/swc/tests/tsc-references/typingsLookupAmd_es5.1.normal.js
index 94e262db9b72..1daa716fcf16 100644
--- a/crates/swc/tests/tsc-references/typingsLookupAmd_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/typingsLookupAmd_es5.1.normal.js
@@ -4,3 +4,7 @@
// @module: amd
// @filename: /node_modules/@types/a/index.d.ts
export { };
+// @filename: /x/node_modules/@types/b/index.d.ts
+import { A } from "a";
+// @filename: /x/y/foo.ts
+export { };
diff --git a/crates/swc/tests/tsc-references/typingsLookupAmd_es5.2.minified.js b/crates/swc/tests/tsc-references/typingsLookupAmd_es5.2.minified.js
index 2234b9cae16d..a85d8324c074 100644
--- a/crates/swc/tests/tsc-references/typingsLookupAmd_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/typingsLookupAmd_es5.2.minified.js
@@ -1 +1,3 @@
export { };
+import { A } from "a";
+export { };
diff --git a/crates/swc/tests/tsc-references/unicodeEscapesInJsxtags_es2015.1.normal.js b/crates/swc/tests/tsc-references/unicodeEscapesInJsxtags_es2015.1.normal.js
new file mode 100644
index 000000000000..89aac3543261
--- /dev/null
+++ b/crates/swc/tests/tsc-references/unicodeEscapesInJsxtags_es2015.1.normal.js
@@ -0,0 +1,12 @@
+// @filename: file.tsx
+//!
+//! x Unexpected token `a`. Expected jsx identifier
+//! ,----
+//! 19 | let a = <\u0061>; // works
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/unicodeEscapesInJsxtags_es2015.2.minified.js b/crates/swc/tests/tsc-references/unicodeEscapesInJsxtags_es2015.2.minified.js
new file mode 100644
index 000000000000..89aac3543261
--- /dev/null
+++ b/crates/swc/tests/tsc-references/unicodeEscapesInJsxtags_es2015.2.minified.js
@@ -0,0 +1,12 @@
+// @filename: file.tsx
+//!
+//! x Unexpected token `a`. Expected jsx identifier
+//! ,----
+//! 19 | let a = <\u0061>; // works
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/unicodeEscapesInJsxtags_es5.1.normal.js b/crates/swc/tests/tsc-references/unicodeEscapesInJsxtags_es5.1.normal.js
new file mode 100644
index 000000000000..89aac3543261
--- /dev/null
+++ b/crates/swc/tests/tsc-references/unicodeEscapesInJsxtags_es5.1.normal.js
@@ -0,0 +1,12 @@
+// @filename: file.tsx
+//!
+//! x Unexpected token `a`. Expected jsx identifier
+//! ,----
+//! 19 | let a = <\u0061>; // works
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/unicodeEscapesInJsxtags_es5.2.minified.js b/crates/swc/tests/tsc-references/unicodeEscapesInJsxtags_es5.2.minified.js
new file mode 100644
index 000000000000..89aac3543261
--- /dev/null
+++ b/crates/swc/tests/tsc-references/unicodeEscapesInJsxtags_es5.2.minified.js
@@ -0,0 +1,12 @@
+// @filename: file.tsx
+//!
+//! x Unexpected token `a`. Expected jsx identifier
+//! ,----
+//! 19 | let a = <\u0061>; // works
+//! : ^^^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: Syntax Error
diff --git a/crates/swc/tests/tsc-references/withStatements_es2015.1.normal.js b/crates/swc/tests/tsc-references/withStatements_es2015.1.normal.js
new file mode 100644
index 000000000000..31b6b04f328f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/withStatements_es2015.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
+//! ,----
+//! 2 | with (x) {
+//! : ^^^^
+//! `----
+//!
+//! x With statement are not allowed in strict mode
+//! ,----
+//! 2 | with (x) {
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/withStatements_es2015.2.minified.js b/crates/swc/tests/tsc-references/withStatements_es2015.2.minified.js
new file mode 100644
index 000000000000..31b6b04f328f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/withStatements_es2015.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
+//! ,----
+//! 2 | with (x) {
+//! : ^^^^
+//! `----
+//!
+//! x With statement are not allowed in strict mode
+//! ,----
+//! 2 | with (x) {
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/withStatements_es5.1.normal.js b/crates/swc/tests/tsc-references/withStatements_es5.1.normal.js
new file mode 100644
index 000000000000..31b6b04f328f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/withStatements_es5.1.normal.js
@@ -0,0 +1,18 @@
+//!
+//! x The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
+//! ,----
+//! 2 | with (x) {
+//! : ^^^^
+//! `----
+//!
+//! x With statement are not allowed in strict mode
+//! ,----
+//! 2 | with (x) {
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/withStatements_es5.2.minified.js b/crates/swc/tests/tsc-references/withStatements_es5.2.minified.js
new file mode 100644
index 000000000000..31b6b04f328f
--- /dev/null
+++ b/crates/swc/tests/tsc-references/withStatements_es5.2.minified.js
@@ -0,0 +1,18 @@
+//!
+//! x The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
+//! ,----
+//! 2 | with (x) {
+//! : ^^^^
+//! `----
+//!
+//! x With statement are not allowed in strict mode
+//! ,----
+//! 2 | with (x) {
+//! : ^^^^
+//! `----
+//!
+//!
+//!Caused by:
+//! 0: failed to process input file
+//! 1: error was recoverable, but proceeding would result in wrong codegen
+//! 2: Syntax Error
diff --git a/crates/swc/tests/tsc-references/yieldExpressionInControlFlow_es5.1.normal.js b/crates/swc/tests/tsc-references/yieldExpressionInControlFlow_es5.1.normal.js
index 39e6e3863c4e..9d6e4f3b0e4d 100644
--- a/crates/swc/tests/tsc-references/yieldExpressionInControlFlow_es5.1.normal.js
+++ b/crates/swc/tests/tsc-references/yieldExpressionInControlFlow_es5.1.normal.js
@@ -5,8 +5,7 @@
// @lib: esnext
// @Filename: bug25149.js
import regeneratorRuntime from "regenerator-runtime";
-var _marked = regeneratorRuntime.mark(g);
-var _marked1 = regeneratorRuntime.mark(f);
+var _marked = regeneratorRuntime.mark(f);
function f() {
var o;
return regeneratorRuntime.wrap(function f$(_ctx) {
@@ -28,10 +27,12 @@ function f() {
case "end":
return _ctx.stop();
}
- }, _marked1);
+ }, _marked);
}
// @Filename: alsoFails.ts
// fails in Typescript too
+import regeneratorRuntime from "regenerator-runtime";
+var _marked = regeneratorRuntime.mark(g);
function g() {
var o;
return regeneratorRuntime.wrap(function g$(_ctx) {
diff --git a/crates/swc/tests/tsc-references/yieldExpressionInControlFlow_es5.2.minified.js b/crates/swc/tests/tsc-references/yieldExpressionInControlFlow_es5.2.minified.js
index 6bcfec9819e3..e98048bfe442 100644
--- a/crates/swc/tests/tsc-references/yieldExpressionInControlFlow_es5.2.minified.js
+++ b/crates/swc/tests/tsc-references/yieldExpressionInControlFlow_es5.2.minified.js
@@ -4,30 +4,32 @@ var _marked = regeneratorRuntime.mark(function() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
- o = [];
case 1:
- return _ctx.delegateYield(o, "t0", 3);
- case 3:
- o = _ctx.t0, _ctx.next = 1;
+ return _ctx.next = 4, o;
+ case 4:
+ o = _ctx.sent, _ctx.next = 1;
break;
- case 6:
+ case 7:
case "end":
return _ctx.stop();
}
}, _marked);
-}), _marked1 = regeneratorRuntime.mark(function() {
+});
+import regeneratorRuntime from "regenerator-runtime";
+var _marked = regeneratorRuntime.mark(function() {
var o;
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
+ o = [];
case 1:
- return _ctx.next = 4, o;
- case 4:
- o = _ctx.sent, _ctx.next = 1;
+ return _ctx.delegateYield(o, "t0", 3);
+ case 3:
+ o = _ctx.t0, _ctx.next = 1;
break;
- case 7:
+ case 6:
case "end":
return _ctx.stop();
}
- }, _marked1);
+ }, _marked);
});
diff --git a/crates/swc/tests/tsc.rs b/crates/swc/tests/tsc.rs
index 8da4ba319a9f..e3f2ccf8b1b8 100644
--- a/crates/swc/tests/tsc.rs
+++ b/crates/swc/tests/tsc.rs
@@ -1,17 +1,20 @@
use std::{
fs::create_dir_all,
+ mem,
panic::{catch_unwind, resume_unwind, AssertUnwindSafe},
path::{Path, PathBuf},
+ sync::Arc,
};
use serde::de::DeserializeOwned;
use swc::{
config::{Config, IsModule, JscConfig, Options, SourceMapsConfig},
- Compiler,
+ try_with_handler, Compiler,
};
+use swc_common::{errors::ColorConfig, SourceMap};
use swc_ecma_ast::EsVersion;
use swc_ecma_parser::{Syntax, TsConfig};
-use testing::{NormalizedOutput, Tester};
+use testing::NormalizedOutput;
#[testing::fixture(
"../swc_ecma_parser/tests/tsc/**/*.ts",
@@ -118,49 +121,108 @@ fn matrix() -> Vec<(String, Options)> {
res
}
+fn is_filename_directives(line: &str) -> bool {
+ line.starts_with("// @Filename:")
+ || line.starts_with("// @filename:")
+ || line.starts_with("//@Filename:")
+ || line.starts_with("//@filename:")
+}
+
fn compile(input: &Path, output: &Path, opts: Options) {
- Tester::new()
- .print_errors(|cm, handler| {
- let c = Compiler::new(cm.clone());
-
- let fm = cm.load_file(input).expect("failed to load file");
-
- match c.process_js_file(
- fm,
- &handler,
- &Options {
- config: Config {
- jsc: JscConfig {
- syntax: Some(Syntax::Typescript(TsConfig {
- tsx: input.to_string_lossy().ends_with(".tsx"),
- decorators: true,
- dts: false,
- no_early_errors: false,
- })),
- external_helpers: true.into(),
- ..opts.config.jsc
- },
- source_maps: Some(SourceMapsConfig::Bool(
- !input.to_string_lossy().contains("Unicode"),
- )),
- is_module: IsModule::Bool(true),
- ..opts.config
- },
- ..opts
- },
- ) {
- Ok(res) => {
- NormalizedOutput::from(res.code)
- .compare_to_file(output)
- .unwrap();
+ let cm = Arc::::default();
+
+ let c = Compiler::new(cm.clone());
+
+ let fm = cm.load_file(input).expect("failed to load file");
+
+ let mut files = vec![];
+
+ if fm.src.lines().any(is_filename_directives) {
+ let mut buffer = String::default();
+
+ let mut iter = fm.src.lines();
+
+ let mut meta_line = None;
+
+ loop {
+ let line = iter.next();
+ if line.map_or(true, is_filename_directives) {
+ if !buffer.is_empty() {
+ let mut source = String::default();
+ mem::swap(&mut source, &mut buffer);
+
+ files.push((
+ meta_line,
+ cm.new_source_file(swc_common::FileName::Anon, source),
+ ));
}
- Err(ref err) if format!("{:?}", err).contains("Syntax Error") => {}
- Err(ref err) if format!("{:?}", err).contains("not matched") => {}
- Err(err) => panic!("Error: {:?}", err),
+ meta_line = line;
}
- Ok(())
- })
- .map(|_| ())
- .expect("failed");
+ if let Some(line) = line {
+ buffer += line;
+ buffer.push('\n');
+ } else {
+ break;
+ }
+ }
+ } else {
+ files = vec![(None, fm)];
+ }
+
+ let mut result = String::default();
+
+ let options = Options {
+ config: Config {
+ jsc: JscConfig {
+ syntax: Some(Syntax::Typescript(TsConfig {
+ tsx: input.to_string_lossy().ends_with(".tsx"),
+ decorators: true,
+ dts: false,
+ no_early_errors: false,
+ })),
+ external_helpers: true.into(),
+ ..opts.config.jsc
+ },
+ source_maps: Some(SourceMapsConfig::Bool(
+ !input.to_string_lossy().contains("Unicode"),
+ )),
+ is_module: IsModule::Bool(true),
+ ..opts.config
+ },
+ ..opts
+ };
+
+ for (meta_line, file) in files {
+ match try_with_handler(
+ cm.clone(),
+ swc::HandlerOpts {
+ color: ColorConfig::Never,
+ skip_filename: true,
+ },
+ |handler| c.process_js_file(file, handler, &options),
+ ) {
+ Ok(res) => {
+ result += &res.code;
+ }
+ Err(ref err) => {
+ let error_text = format!("{:?}", err);
+
+ if let Some(meta_line) = meta_line {
+ result += meta_line;
+ result.push('\n');
+ }
+
+ for line in error_text.lines() {
+ result.push_str("//!");
+ result.push_str(line);
+ result.push('\n');
+ }
+ }
+ }
+ }
+
+ NormalizedOutput::from(result)
+ .compare_to_file(output)
+ .unwrap();
}