diff --git a/crates/swc/tests/fixture/issues-6xxx/6438/output/index.js b/crates/swc/tests/fixture/issues-6xxx/6438/output/index.js index 2dac17589ef36..e69de29bb2d1d 100644 --- a/crates/swc/tests/fixture/issues-6xxx/6438/output/index.js +++ b/crates/swc/tests/fixture/issues-6xxx/6438/output/index.js @@ -1 +0,0 @@ -new Date()?.toLocaleDateString(); diff --git a/crates/swc/tests/fixture/issues-8xxx/8398/output/index.js b/crates/swc/tests/fixture/issues-8xxx/8398/output/index.js index df42c1d7e65ee..34b5e46bc690e 100644 --- a/crates/swc/tests/fixture/issues-8xxx/8398/output/index.js +++ b/crates/swc/tests/fixture/issues-8xxx/8398/output/index.js @@ -1 +1 @@ -(obj?.a).b,(obj?.a)(),(obj?.a)[0],(obj?.a)`hello`,(obj.a?.()).a,(obj.a?.())(),(obj.a?.())[0],(obj.a?.())`hello`,a?.b,a?.(); +(obj?.a).b,(obj?.a)(),(obj?.a)[0],(obj.a?.()).a,(obj.a?.())(),(obj.a?.())[0]; diff --git a/crates/swc/tests/fixture/issues-8xxx/8737/output/1.js b/crates/swc/tests/fixture/issues-8xxx/8737/output/1.js index bb0fd3bbeaa51..543bcae0320bb 100644 --- a/crates/swc/tests/fixture/issues-8xxx/8737/output/1.js +++ b/crates/swc/tests/fixture/issues-8xxx/8737/output/1.js @@ -1,6 +1,6 @@ d(function() { var b = function() { - return a, "some string"; + return "some string"; }; return function() { return b; diff --git a/crates/swc/tests/tsc-references/InvalidNonInstantiatedModule.2.minified.js b/crates/swc/tests/tsc-references/InvalidNonInstantiatedModule.2.minified.js index e3992c216ff1c..f72d5afa282cc 100644 --- a/crates/swc/tests/tsc-references/InvalidNonInstantiatedModule.2.minified.js +++ b/crates/swc/tests/tsc-references/InvalidNonInstantiatedModule.2.minified.js @@ -1,2 +1 @@ //// [InvalidNonInstantiatedModule.ts] -M; diff --git a/crates/swc/tests/tsc-references/MemberFunctionDeclaration3_es6.2.minified.js b/crates/swc/tests/tsc-references/MemberFunctionDeclaration3_es6.2.minified.js index 50076f202adab..205693c31d121 100644 --- a/crates/swc/tests/tsc-references/MemberFunctionDeclaration3_es6.2.minified.js +++ b/crates/swc/tests/tsc-references/MemberFunctionDeclaration3_es6.2.minified.js @@ -1,2 +1 @@ //// [MemberFunctionDeclaration3_es6.ts] -foo; diff --git a/crates/swc/tests/tsc-references/asOpEmitParens.2.minified.js b/crates/swc/tests/tsc-references/asOpEmitParens.2.minified.js index 97ced9df0a6e6..679082f3999c3 100644 --- a/crates/swc/tests/tsc-references/asOpEmitParens.2.minified.js +++ b/crates/swc/tests/tsc-references/asOpEmitParens.2.minified.js @@ -1,2 +1,2 @@ //// [asOpEmitParens.ts] -x, x.y, new (x()); +x.y, new (x()); diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion.2.minified.js index 347ed618413b7..f44b3959a905b 100644 --- a/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion.2.minified.js +++ b/crates/swc/tests/tsc-references/assignmentCompatWithDiscriminatedUnion.2.minified.js @@ -5,4 +5,4 @@ Example1 || (Example1 = {}), t = s, Example2 || (Example2 = {}), t = s, Example3 return "categorical"; } getAxisType(), getAxisType(); -}(GH12052 || (GH12052 = {})), GH18421 || (GH18421 = {}), GH15907 || (GH15907 = {}), GH20889 || (GH20889 = {}), GH39357 || (GH39357 = {}), ("a" === b || "b" === b) && b; +}(GH12052 || (GH12052 = {})), GH18421 || (GH18421 = {}), GH15907 || (GH15907 = {}), GH20889 || (GH20889 = {}), GH39357 || (GH39357 = {}); diff --git a/crates/swc/tests/tsc-references/checkJsxGenericTagHasCorrectInferences.2.minified.js b/crates/swc/tests/tsc-references/checkJsxGenericTagHasCorrectInferences.2.minified.js index 4fab0d97020b5..59d9210694e8f 100644 --- a/crates/swc/tests/tsc-references/checkJsxGenericTagHasCorrectInferences.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsxGenericTagHasCorrectInferences.2.minified.js @@ -1,3 +1,2 @@ //// [file.tsx] import * as React from "react"; -/*#__PURE__*/ GenericComponent, /*#__PURE__*/ GenericComponent, /*#__PURE__*/ GenericComponent, /*#__PURE__*/ GenericComponent; diff --git a/crates/swc/tests/tsc-references/classAbstractSingleLineDecl.2.minified.js b/crates/swc/tests/tsc-references/classAbstractSingleLineDecl.2.minified.js index 532ba3b73cd26..60bc5a5ee60a9 100644 --- a/crates/swc/tests/tsc-references/classAbstractSingleLineDecl.2.minified.js +++ b/crates/swc/tests/tsc-references/classAbstractSingleLineDecl.2.minified.js @@ -1,6 +1,6 @@ //// [classAbstractSingleLineDecl.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; -abstract, abstract, new function A() { +new function A() { _class_call_check(this, A); }, new function B() { _class_call_check(this, B); diff --git a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.2.minified.js b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.2.minified.js index b36105ce9411e..279d6740e131e 100644 --- a/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.2.minified.js +++ b/crates/swc/tests/tsc-references/classCanExtendConstructorFunction.2.minified.js @@ -26,7 +26,7 @@ var db = new /*#__PURE__*/ (function(Wagon) { _get(_get_prototype_of(Sql.prototype), "speed", this).call(this), _get(_get_prototype_of(Sql.prototype), "weight", this).call(this); }, Sql; }(Wagon))(); -db.numberOxen = db.foonly, /*#__PURE__*/ Dragon; +db.numberOxen = db.foonly; //// [second.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; diff --git a/crates/swc/tests/tsc-references/classExtendingClassLikeType.2.minified.js b/crates/swc/tests/tsc-references/classExtendingClassLikeType.2.minified.js index ef233992349a1..ac096a02fc1ed 100644 --- a/crates/swc/tests/tsc-references/classExtendingClassLikeType.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendingClassLikeType.2.minified.js @@ -2,4 +2,4 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ Base, /*#__PURE__*/ getBase(), /*#__PURE__*/ getBase(), /*#__PURE__*/ getBase(), /*#__PURE__*/ getBase(), /*#__PURE__*/ getBadBase(); +/*#__PURE__*/ getBase(), /*#__PURE__*/ getBase(), /*#__PURE__*/ getBase(), /*#__PURE__*/ getBase(), /*#__PURE__*/ getBadBase(); diff --git a/crates/swc/tests/tsc-references/classExtendsItself.2.minified.js b/crates/swc/tests/tsc-references/classExtendsItself.2.minified.js index ed11ca6ca168a..ba0240abfb680 100644 --- a/crates/swc/tests/tsc-references/classExtendsItself.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendsItself.2.minified.js @@ -2,4 +2,3 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ C1, /*#__PURE__*/ D1, /*#__PURE__*/ E1; diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3.2.minified.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3.2.minified.js index e5abd36304b64..44ddb125ac3cf 100644 --- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly3.2.minified.js @@ -2,29 +2,23 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ E; //// [classExtendsItselfIndirectly_file2.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ C; //// [classExtendsItselfIndirectly_file3.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ D; //// [classExtendsItselfIndirectly_file4.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ E2; //// [classExtendsItselfIndirectly_file5.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ C2; //// [classExtendsItselfIndirectly_file6.ts] import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ D2; diff --git a/crates/swc/tests/tsc-references/classStaticBlock11(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/classStaticBlock11(target=es2015).2.minified.js index 879c4295abb6b..556619d3d525c 100644 --- a/crates/swc/tests/tsc-references/classStaticBlock11(target=es2015).2.minified.js +++ b/crates/swc/tests/tsc-references/classStaticBlock11(target=es2015).2.minified.js @@ -2,3 +2,4 @@ import { _ as _class_private_field_get } from "@swc/helpers/_/_class_private_field_get"; import "@swc/helpers/_/_class_private_field_init"; import "@swc/helpers/_/_class_private_field_set"; +var _x = /*#__PURE__*/ new WeakMap(); diff --git a/crates/swc/tests/tsc-references/classStaticBlock5(target=es2022).2.minified.js b/crates/swc/tests/tsc-references/classStaticBlock5(target=es2022).2.minified.js index 0bfcebbe18920..5774b7fe39392 100644 --- a/crates/swc/tests/tsc-references/classStaticBlock5(target=es2022).2.minified.js +++ b/crates/swc/tests/tsc-references/classStaticBlock5(target=es2022).2.minified.js @@ -15,6 +15,6 @@ class C extends B { this.c = super.a; } static{ - this.b, super.b, super.a; + this.b; } } diff --git a/crates/swc/tests/tsc-references/classStaticBlock5(target=esnext).2.minified.js b/crates/swc/tests/tsc-references/classStaticBlock5(target=esnext).2.minified.js index 0bfcebbe18920..5774b7fe39392 100644 --- a/crates/swc/tests/tsc-references/classStaticBlock5(target=esnext).2.minified.js +++ b/crates/swc/tests/tsc-references/classStaticBlock5(target=esnext).2.minified.js @@ -15,6 +15,6 @@ class C extends B { this.c = super.a; } static{ - this.b, super.b, super.a; + this.b; } } diff --git a/crates/swc/tests/tsc-references/commonTypeIntersection.2.minified.js b/crates/swc/tests/tsc-references/commonTypeIntersection.2.minified.js index 281bd442c0b1c..592a51a791e28 100644 --- a/crates/swc/tests/tsc-references/commonTypeIntersection.2.minified.js +++ b/crates/swc/tests/tsc-references/commonTypeIntersection.2.minified.js @@ -1,2 +1 @@ //// [commonTypeIntersection.ts] -x1, x2; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithIntersectionType.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithIntersectionType.2.minified.js index 9523c9c2c1f7b..9da6da94d5598 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithIntersectionType.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithIntersectionType.2.minified.js @@ -1,2 +1 @@ //// [comparisonOperatorWithIntersectionType.ts] -a, b; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNumberOperand.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNumberOperand.2.minified.js index 30d6f81e34a50..65f1bb1c017ae 100644 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithNumberOperand.2.minified.js +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNumberOperand.2.minified.js @@ -1,2 +1 @@ //// [comparisonOperatorWithNumberOperand.ts] -t1; diff --git a/crates/swc/tests/tsc-references/controlFlowForInStatement2.2.minified.js b/crates/swc/tests/tsc-references/controlFlowForInStatement2.2.minified.js index 4729c48f0b547..0b7ce6f33978b 100644 --- a/crates/swc/tests/tsc-references/controlFlowForInStatement2.2.minified.js +++ b/crates/swc/tests/tsc-references/controlFlowForInStatement2.2.minified.js @@ -1,2 +1 @@ //// [controlFlowForInStatement2.ts] -'a' in c && c, 'a' in c && c, 'b' in c && c, 'b' in c && c; diff --git a/crates/swc/tests/tsc-references/controlFlowInOperator.2.minified.js b/crates/swc/tests/tsc-references/controlFlowInOperator.2.minified.js index 115da5ee52ccf..a9b3c02ba4902 100644 --- a/crates/swc/tests/tsc-references/controlFlowInOperator.2.minified.js +++ b/crates/swc/tests/tsc-references/controlFlowInOperator.2.minified.js @@ -1,2 +1,2 @@ //// [controlFlowInOperator.ts] -'a' in c && (c, c.a), 'd' in c && c, 'a' in c && (c, c.a), 'd' in c && c; +'a' in c && c.a, 'a' in c && c.a; diff --git a/crates/swc/tests/tsc-references/controlFlowNullishCoalesce.2.minified.js b/crates/swc/tests/tsc-references/controlFlowNullishCoalesce.2.minified.js index 56084f302b456..7959c40e1c57e 100644 --- a/crates/swc/tests/tsc-references/controlFlowNullishCoalesce.2.minified.js +++ b/crates/swc/tests/tsc-references/controlFlowNullishCoalesce.2.minified.js @@ -1,3 +1,3 @@ //// [controlFlowNullishCoalesce.ts] var a; -null != o ? o : a = 1, a.toString(), null == o || o; +null != o || (a = 1), a.toString(); diff --git a/crates/swc/tests/tsc-references/controlFlowOptionalChain.2.minified.js b/crates/swc/tests/tsc-references/controlFlowOptionalChain.2.minified.js index 07586d240342c..53431af8053bd 100644 --- a/crates/swc/tests/tsc-references/controlFlowOptionalChain.2.minified.js +++ b/crates/swc/tests/tsc-references/controlFlowOptionalChain.2.minified.js @@ -4,7 +4,7 @@ import "@swc/helpers/_/_type_of"; function someFunction(someOptionalObject) { (null == someOptionalObject ? void 0 : someOptionalObject.someProperty) !== lastSomeProperty && (console.log(someOptionalObject), console.log(someOptionalObject.someProperty), lastSomeProperty = null == someOptionalObject ? void 0 : someOptionalObject.someProperty); } -null == o || o[a = 1], a.toString(), null == o || o.x[b = 1], b.toString(), null == o || o(c = 1), c.toString(), null == o || o.x(d = 1), d.toString(), null == f || f(x), x, f, f(x), x, f, f(x), (null == o2 ? void 0 : o2.f(x)) ? (x, o2.f, null == o2 || o2.f, null == o2 || o2.f(x)) : (x, o2, null == o2 || o2.f, o2.f), x, o2, null == o2 || o2.f, o2.f, (null == o3 ? void 0 : o3.x) === 1 ? (o3, o3.x, null == o3 || o3.x) : (o3, null == o3 || o3.x, o3.x), o3, null == o3 || o3.x, o3.x, (null === (_o4_x = o4.x) || void 0 === _o4_x ? void 0 : _o4_x.y) ? (o4.x, o4.x.y, null === (_o4_x2 = o4.x) || void 0 === _o4_x2 || _o4_x2.y) : (o4.x, null === (_o4_x3 = o4.x) || void 0 === _o4_x3 || _o4_x3.y, o4.x.y), o4.x, null === (_o4_x1 = o4.x) || void 0 === _o4_x1 || _o4_x1.y, o4.x.y, (null === (_o5_x = o5.x) || void 0 === _o5_x ? void 0 : null === (_o5_x_y_z = _o5_x.y.z) || void 0 === _o5_x_y_z ? void 0 : _o5_x_y_z.w) ? (o5.x, o5.x.y, o5.x.y.z, o5.x.y.z.w, null === (_o5_x_y_z2 = o5.x.y.z) || void 0 === _o5_x_y_z2 || _o5_x_y_z2.w, null === (_o5_x4 = o5.x) || void 0 === _o5_x4 || _o5_x4.y.z.w, null === (_o5_x5 = o5.x) || void 0 === _o5_x5 || null === (_o5_x_y_z3 = _o5_x5.y.z) || void 0 === _o5_x_y_z3 || _o5_x_y_z3.w) : (o5.x, null === (_o5_x6 = o5.x) || void 0 === _o5_x6 || _o5_x6.y, null === (_o5_x7 = o5.x) || void 0 === _o5_x7 || _o5_x7.y.z, null === (_o5_x8 = o5.x) || void 0 === _o5_x8 || null === (_o5_x_y_z4 = _o5_x8.y.z) || void 0 === _o5_x_y_z4 || _o5_x_y_z4.w, o5.x.y, o5.x.y.z.w), o5.x, null === (_o5_x1 = o5.x) || void 0 === _o5_x1 || _o5_x1.y, null === (_o5_x2 = o5.x) || void 0 === _o5_x2 || _o5_x2.y.z, null === (_o5_x3 = o5.x) || void 0 === _o5_x3 || null === (_o5_x_y_z1 = _o5_x3.y.z) || void 0 === _o5_x_y_z1 || _o5_x_y_z1.w, o5.x.y, o5.x.y.z.w, (null == o6 ? void 0 : o6.f()) ? o6 : (o6, null == o6 || o6.f), o6.f, o6, null == o6 || o6.f, o6.f, someFunction({ +null == o || o[a = 1], a.toString(), null == o || o.x[b = 1], b.toString(), null == o || o(c = 1), c.toString(), null == o || o.x(d = 1), d.toString(), null == f || f(x), f(x), f(x), (null == o2 ? void 0 : o2.f(x)) ? (o2.f, null == o2 || o2.f, null == o2 || o2.f(x)) : (null == o2 || o2.f, o2.f), null == o2 || o2.f, o2.f, (null == o3 ? void 0 : o3.x) === 1 ? (o3.x, null == o3 || o3.x) : (null == o3 || o3.x, o3.x), null == o3 || o3.x, o3.x, (null === (_o4_x = o4.x) || void 0 === _o4_x ? void 0 : _o4_x.y) ? (o4.x, o4.x.y, null === (_o4_x2 = o4.x) || void 0 === _o4_x2 || _o4_x2.y) : (o4.x, null === (_o4_x3 = o4.x) || void 0 === _o4_x3 || _o4_x3.y, o4.x.y), o4.x, null === (_o4_x1 = o4.x) || void 0 === _o4_x1 || _o4_x1.y, o4.x.y, (null === (_o5_x = o5.x) || void 0 === _o5_x ? void 0 : null === (_o5_x_y_z = _o5_x.y.z) || void 0 === _o5_x_y_z ? void 0 : _o5_x_y_z.w) ? (o5.x, o5.x.y, o5.x.y.z, o5.x.y.z.w, null === (_o5_x_y_z2 = o5.x.y.z) || void 0 === _o5_x_y_z2 || _o5_x_y_z2.w, null === (_o5_x4 = o5.x) || void 0 === _o5_x4 || _o5_x4.y.z.w, null === (_o5_x5 = o5.x) || void 0 === _o5_x5 || null === (_o5_x_y_z3 = _o5_x5.y.z) || void 0 === _o5_x_y_z3 || _o5_x_y_z3.w) : (o5.x, null === (_o5_x6 = o5.x) || void 0 === _o5_x6 || _o5_x6.y, null === (_o5_x7 = o5.x) || void 0 === _o5_x7 || _o5_x7.y.z, null === (_o5_x8 = o5.x) || void 0 === _o5_x8 || null === (_o5_x_y_z4 = _o5_x8.y.z) || void 0 === _o5_x_y_z4 || _o5_x_y_z4.w, o5.x.y, o5.x.y.z.w), o5.x, null === (_o5_x1 = o5.x) || void 0 === _o5_x1 || _o5_x1.y, null === (_o5_x2 = o5.x) || void 0 === _o5_x2 || _o5_x2.y.z, null === (_o5_x3 = o5.x) || void 0 === _o5_x3 || null === (_o5_x_y_z1 = _o5_x3.y.z) || void 0 === _o5_x_y_z1 || _o5_x_y_z1.w, o5.x.y, o5.x.y.z.w, (null == o6 ? void 0 : o6.f()) || null == o6 || o6.f, o6.f, null == o6 || o6.f, o6.f, someFunction({ someProperty: 42 }), someFunction(void 0); for(var _o4_x, _o4_x1, _o5_x_y_z, _o5_x, _o5_x1, _o5_x2, _o5_x_y_z1, _o5_x3, _arr_i, a, b, c, d, _o4_x2, _o4_x3, _o5_x_y_z2, _o5_x4, _o5_x_y_z3, _o5_x5, _o5_x6, _o5_x7, _o5_x_y_z4, _o5_x8, lastSomeProperty, _arr_i1, i = 0; (null === (_arr_i = arr[i]) || void 0 === _arr_i ? void 0 : _arr_i.tag) === "left";)i += 1, (null === (_arr_i1 = arr[i]) || void 0 === _arr_i1 ? void 0 : _arr_i1.tag) === "right" && console.log("I should ALSO be reachable"); diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01.2.minified.js b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01.2.minified.js index 1b168847d551f..7d297571fa850 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01.2.minified.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments01.2.minified.js @@ -1,2 +1 @@ //// [emitArrowFunctionWhenUsingArguments01.ts] -arguments; diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments02.2.minified.js b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments02.2.minified.js index 83f510a2d716c..53c79ff868695 100644 --- a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments02.2.minified.js +++ b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments02.2.minified.js @@ -1,2 +1 @@ //// [emitArrowFunctionWhenUsingArguments02.ts] -arguments; diff --git a/crates/swc/tests/tsc-references/errorSuperPropertyAccess.2.minified.js b/crates/swc/tests/tsc-references/errorSuperPropertyAccess.2.minified.js index 9649e2731259d..ba0e5d41a6ce2 100644 --- a/crates/swc/tests/tsc-references/errorSuperPropertyAccess.2.minified.js +++ b/crates/swc/tests/tsc-references/errorSuperPropertyAccess.2.minified.js @@ -14,4 +14,4 @@ var SomeBase = /*#__PURE__*/ function() { var _proto = SomeBase.prototype; return _proto.privateFunc = function() {}, _proto.publicFunc = function() {}, SomeBase.privateStaticFunc = function() {}, SomeBase.publicStaticFunc = function() {}, SomeBase; }(); -SomeBase.privateStaticMember = 0, SomeBase.publicStaticMember = 0, super.wat, super.foo(); +SomeBase.privateStaticMember = 0, SomeBase.publicStaticMember = 0, super.foo(); diff --git a/crates/swc/tests/tsc-references/for-of7.2.minified.js b/crates/swc/tests/tsc-references/for-of7.2.minified.js index c987e89fe5866..658afaed6bc6e 100644 --- a/crates/swc/tests/tsc-references/for-of7.2.minified.js +++ b/crates/swc/tests/tsc-references/for-of7.2.minified.js @@ -1,4 +1,4 @@ //// [for-of7.ts] -for (let v1 of (v, [ +for (let v1 of [ 0 -])); +]); diff --git a/crates/swc/tests/tsc-references/genericContextualTypes1.2.minified.js b/crates/swc/tests/tsc-references/genericContextualTypes1.2.minified.js index 41774cc51d67e..3ade5bda71a6c 100644 --- a/crates/swc/tests/tsc-references/genericContextualTypes1.2.minified.js +++ b/crates/swc/tests/tsc-references/genericContextualTypes1.2.minified.js @@ -1,5 +1,5 @@ //// [genericContextualTypes1.ts] -list, wrap(list), wrap(function(x) { +wrap(list), wrap(function(x) { return [ x ]; diff --git a/crates/swc/tests/tsc-references/importClause_default.2.minified.js b/crates/swc/tests/tsc-references/importClause_default.2.minified.js index f1f8cb1c81d85..f76ddb01bbe24 100644 --- a/crates/swc/tests/tsc-references/importClause_default.2.minified.js +++ b/crates/swc/tests/tsc-references/importClause_default.2.minified.js @@ -5,5 +5,5 @@ var A = function A() { }; export { A as default }; //// [/b.ts] -new A(), A; +new A(); export { }; diff --git a/crates/swc/tests/tsc-references/independentPropertyVariance.2.minified.js b/crates/swc/tests/tsc-references/independentPropertyVariance.2.minified.js index 1977eced9fac6..b3722a3cad40f 100644 --- a/crates/swc/tests/tsc-references/independentPropertyVariance.2.minified.js +++ b/crates/swc/tests/tsc-references/independentPropertyVariance.2.minified.js @@ -1,2 +1 @@ //// [independentPropertyVariance.ts] -x, y; diff --git a/crates/swc/tests/tsc-references/instanceofOperatorWithRHSHasSymbolHasInstance.2.minified.js b/crates/swc/tests/tsc-references/instanceofOperatorWithRHSHasSymbolHasInstance.2.minified.js index 003bae624f974..aca01bf8856a3 100644 --- a/crates/swc/tests/tsc-references/instanceofOperatorWithRHSHasSymbolHasInstance.2.minified.js +++ b/crates/swc/tests/tsc-references/instanceofOperatorWithRHSHasSymbolHasInstance.2.minified.js @@ -1,2 +1 @@ //// [instanceofOperatorWithRHSHasSymbolHasInstance.ts] -lhs0 instanceof rhs0 && lhs0, lhs0 instanceof rhs1 && lhs0, lhs0 instanceof rhs2 && lhs0, lhs0 instanceof rhs3 && lhs0, lhs0 instanceof rhs4 && lhs0, lhs0 instanceof rhs5 && lhs0, lhs0 instanceof rhs6 && lhs0, lhs0 instanceof Rhs7 && lhs0, lhs0 instanceof Rhs8 && lhs0, lhs0 instanceof Rhs9 && lhs0, lhs0 instanceof Rhs10 && lhs0, lhs0 instanceof Rhs11 && lhs0, lhs0 instanceof Rhs12 && lhs0, lhs0 instanceof Rhs13 && lhs0, lhs1 instanceof rhs0 && lhs1, lhs1 instanceof rhs1 && lhs1, lhs1 instanceof rhs2 && lhs1, lhs1 instanceof Rhs7 && lhs1, lhs1 instanceof Rhs8 && lhs1, lhs1 instanceof Rhs9 && lhs1, lhs2 instanceof rhs0 && lhs2, lhs2 instanceof rhs1 && lhs2, lhs2 instanceof rhs2 && lhs2, lhs2 instanceof rhs3 && lhs2, lhs2 instanceof rhs4 && lhs2, lhs2 instanceof rhs5 && lhs2, lhs2 instanceof Rhs7 && lhs2, lhs2 instanceof Rhs8 && lhs2, lhs2 instanceof Rhs9 && lhs2, lhs2 instanceof Rhs10 && lhs2, lhs2 instanceof Rhs11 && lhs2, lhs2 instanceof Rhs12 && lhs2, lhs3 instanceof rhs0 && lhs3, lhs3 instanceof rhs1 && lhs3, lhs3 instanceof rhs2 && lhs3, lhs3 instanceof rhs3 && lhs3, lhs3 instanceof rhs4 && lhs3, lhs3 instanceof rhs5 && lhs3, lhs3 instanceof rhs6 && lhs3, lhs3 instanceof Rhs7 && lhs3, lhs3 instanceof Rhs8 && lhs3, lhs3 instanceof Rhs9 && lhs3, lhs3 instanceof Rhs10 && lhs3, lhs3 instanceof Rhs11 && lhs3, lhs3 instanceof Rhs12 && lhs3, lhs3 instanceof Rhs13 && lhs3, lhs4 instanceof rhs0 && lhs4, lhs4 instanceof rhs1 && lhs4, lhs4 instanceof rhs2 && lhs4, lhs4 instanceof rhs3 && lhs4, lhs4 instanceof rhs4 && lhs4, lhs4 instanceof rhs5 && lhs4, lhs4 instanceof Rhs7 && lhs4, lhs4 instanceof Rhs8 && lhs4, lhs4 instanceof Rhs9 && lhs4, lhs4 instanceof Rhs10 && lhs4, lhs4 instanceof Rhs11 && lhs4, lhs4 instanceof Rhs12 && lhs4, obj instanceof A && obj, obj instanceof B && obj, lhs0 instanceof rhs14 && lhs0, lhs0 instanceof rhs15 && lhs0; diff --git a/crates/swc/tests/tsc-references/intersectionReduction.2.minified.js b/crates/swc/tests/tsc-references/intersectionReduction.2.minified.js index 7239188917a2f..5558dd03928f9 100644 --- a/crates/swc/tests/tsc-references/intersectionReduction.2.minified.js +++ b/crates/swc/tests/tsc-references/intersectionReduction.2.minified.js @@ -1,2 +1,2 @@ //// [intersectionReduction.ts] -ab.kind, x, f10(a1), f10(a2), s2 = s1 = s2, t2 = t1 = t2, shouldBeB; +ab.kind, f10(a1), f10(a2), s2 = s1 = s2, t2 = t1 = t2; diff --git a/crates/swc/tests/tsc-references/intersectionReductionStrict.2.minified.js b/crates/swc/tests/tsc-references/intersectionReductionStrict.2.minified.js index ba1adb48659ad..3f84d5d30ec2f 100644 --- a/crates/swc/tests/tsc-references/intersectionReductionStrict.2.minified.js +++ b/crates/swc/tests/tsc-references/intersectionReductionStrict.2.minified.js @@ -1,2 +1,2 @@ //// [intersectionReductionStrict.ts] -ab.kind, x, s2 = s1 = s2, t2 = t1 = t2; +ab.kind, s2 = s1 = s2, t2 = t1 = t2; diff --git a/crates/swc/tests/tsc-references/intersectionWithIndexSignatures.2.minified.js b/crates/swc/tests/tsc-references/intersectionWithIndexSignatures.2.minified.js index bfb6d52871eca..360123bea6126 100644 --- a/crates/swc/tests/tsc-references/intersectionWithIndexSignatures.2.minified.js +++ b/crates/swc/tests/tsc-references/intersectionWithIndexSignatures.2.minified.js @@ -1,2 +1,2 @@ //// [intersectionWithIndexSignatures.ts] -ta1 = sa1, ta1 = sa2, ta2 = sa1, ta2 = sa2, tb1 = sb1, q.asd.a.substr(1), q.asd.b, q, tt = ss; +ta1 = sa1, ta1 = sa2, ta2 = sa1, ta2 = sa2, tb1 = sb1, q.asd.a.substr(1), q.asd.b, tt = ss; diff --git a/crates/swc/tests/tsc-references/jsxReactTestSuite.2.minified.js b/crates/swc/tests/tsc-references/jsxReactTestSuite.2.minified.js index 6a937b0365788..2031847bfb99c 100644 --- a/crates/swc/tests/tsc-references/jsxReactTestSuite.2.minified.js +++ b/crates/swc/tests/tsc-references/jsxReactTestSuite.2.minified.js @@ -1,29 +1,29 @@ //// [jsxReactTestSuite.tsx] import { _ as _object_spread } from "@swc/helpers/_/_object_spread"; import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props"; -/*#__PURE__*/ this.props.children, Component, foo, bar, Composite, this.props.children, Composite, /*#__PURE__*/ Composite2; +/*#__PURE__*/ this.props.children, this.props.children; var x = /*#__PURE__*/ React.createElement("div", { attr1: "foobar", attr2: "foobarbazbug", attr3: "foobarbazbug", attr4: "baz" }); -/*#__PURE__*/ Component, /*#__PURE__*/ Namespace.Component, /*#__PURE__*/ Namespace.DeepNamespace.Component, Component, _object_spread_props(_object_spread({}, x), { +/*#__PURE__*/ Namespace.Component, /*#__PURE__*/ Namespace.DeepNamespace.Component, _object_spread_props(_object_spread({}, x), { y: 2, z: !0 -}), Component, _object_spread_props(_object_spread({}, this.props), { +}), _object_spread_props(_object_spread({}, this.props), { sound: "moo" -}), Component, y, /*#__PURE__*/ Component, Component, _object_spread_props(_object_spread({}, x), { +}), _object_spread_props(_object_spread({}, x), { y: 2 -}), Component, _object_spread_props(_object_spread({}, x), { +}), _object_spread_props(_object_spread({}, x), { y: 2, z: !0 -}), Component, _object_spread({ +}), _object_spread({ x: 1 -}, y), Component, _object_spread({ +}, y), _object_spread({ x: 1, y: "2" -}, z, z), /*#__PURE__*/ Child, Component, _object_spread_props(_object_spread({ +}, z, z), _object_spread_props(_object_spread({ x: "1" }, z = { y: 2 diff --git a/crates/swc/tests/tsc-references/logicalAssignment1(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/logicalAssignment1(target=es2015).2.minified.js index 84bef276885a2..a7c885451dbc1 100644 --- a/crates/swc/tests/tsc-references/logicalAssignment1(target=es2015).2.minified.js +++ b/crates/swc/tests/tsc-references/logicalAssignment1(target=es2015).2.minified.js @@ -1,2 +1,2 @@ //// [logicalAssignment1.ts] -a && (a = "foo"), b || (b = "foo"), null != c ? c : c = "foo", d && (d = 42), e || (e = 42), null != f ? f : f = 42, g && (g = 42), h || (h = 42), null != i ? i : i = 42; +a && (a = "foo"), b || (b = "foo"), null != c || (c = "foo"), d && (d = 42), e || (e = 42), null != f || (f = 42), g && (g = 42), h || (h = 42), null != i || (i = 42); diff --git a/crates/swc/tests/tsc-references/mixinClassesMembers.2.minified.js b/crates/swc/tests/tsc-references/mixinClassesMembers.2.minified.js index 9833d67a1c44e..03a3046e199e1 100644 --- a/crates/swc/tests/tsc-references/mixinClassesMembers.2.minified.js +++ b/crates/swc/tests/tsc-references/mixinClassesMembers.2.minified.js @@ -4,4 +4,3 @@ import { _ as _get } from "@swc/helpers/_/_get"; import { _ as _get_prototype_of } from "@swc/helpers/_/_get_prototype_of"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ Mixed1, /*#__PURE__*/ Mixed3; diff --git a/crates/swc/tests/tsc-references/moduleScoping.2.minified.js b/crates/swc/tests/tsc-references/moduleScoping.2.minified.js index 90e9733439bf3..1b23ee90328d7 100644 --- a/crates/swc/tests/tsc-references/moduleScoping.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleScoping.2.minified.js @@ -12,4 +12,3 @@ export var v3 = !0; //! 4 | var t3 = file3.v3; //! `---- //// [file5.ts] -v2; diff --git a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire.2.minified.js b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire.2.minified.js index 3ab8c1dcd97c6..90fc1b348b13f 100644 --- a/crates/swc/tests/tsc-references/nestedDestructuringOfRequire.2.minified.js +++ b/crates/swc/tests/tsc-references/nestedDestructuringOfRequire.2.minified.js @@ -4,4 +4,4 @@ module.exports.chalk = { grey: {} }; //// [main.js] -require('./mod1').chalk.grey, chalk; +require('./mod1').chalk.grey; diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator1.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator1.2.minified.js index c543ceda77b21..b3b4e9773f0d0 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator1.2.minified.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator1.2.minified.js @@ -1,2 +1,2 @@ //// [nullishCoalescingOperator1.ts] -null != a1 && a1, null != a2 && a2, null != a3 && a3, null != a4 && a4, null != b1 && b1, null != b2 && b2, null != b3 && b3, null != b4 && b4, null == c1 || c1, null == c2 || c2, null == c3 || c3, null == c4 || c4, null != d1 && d1, null != d2 && d2, null != d3 && d3, null != d4 && d4, foo(), foo(), foo(); +foo(), foo(), foo(); diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator11.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator11.2.minified.js index 6a30b1c2e2414..e49b28ffd14ec 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator11.2.minified.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator11.2.minified.js @@ -1,2 +1,2 @@ //// [nullishCoalescingOperator11.ts] -null != f11 ? f11 : f11.toFixed(); +null != f11 || f11.toFixed(); diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator2.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator2.2.minified.js index ac5e644aced90..1f6477878b863 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator2.2.minified.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator2.2.minified.js @@ -1,2 +1 @@ //// [nullishCoalescingOperator2.ts] -null != a1 && a1, null != a2 && a2, null != a3 && a3, null != a4 && a4, null != a5 && a5, null != a6 && a6, null != a7 && a7, null != a8 && a8, null != a9 && a9; diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator3.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator3.2.minified.js index 0a314f3f6f88f..cfb11fbf35eaf 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator3.2.minified.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator3.2.minified.js @@ -1,3 +1 @@ //// [nullishCoalescingOperator3.ts] -var _ref, _ref1, _ref2, _ref3; -null !== (_ref3 = null !== (_ref2 = null !== (_ref1 = null !== (_ref = null != a1 ? a1 : a2) && void 0 !== _ref ? _ref : a3) && void 0 !== _ref1 ? _ref1 : a4) && void 0 !== _ref2 ? _ref2 : a5) && void 0 !== _ref3 || a6; diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator4.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator4.2.minified.js index c53da95832bef..c88525e724afc 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator4.2.minified.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator4.2.minified.js @@ -1,2 +1,2 @@ //// [nullishCoalescingOperator4.ts] -null != a1 ? a1 : a1.toLowerCase(), a1 || a1.toLocaleUpperCase(); +null != a1 || a1.toLowerCase(), a1 || a1.toLocaleUpperCase(); diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator7.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator7.2.minified.js index c3f0add06b782..00e79ba2ce1f6 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator7.2.minified.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator7.2.minified.js @@ -1,2 +1 @@ //// [nullishCoalescingOperator7.ts] -a, null != a && a, (null != a ? a : 'foo') ? null != b && b : null != c && c; diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator9.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator9.2.minified.js index 9bf2a36f0ca8c..1fe269df614ff 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator9.2.minified.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator9.2.minified.js @@ -1,2 +1 @@ //// [nullishCoalescingOperator9.ts] -f, null != f && f; diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator_es2020.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator_es2020.2.minified.js index ab37ff6a9405a..3429217f8d6bf 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator_es2020.2.minified.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator_es2020.2.minified.js @@ -1,2 +1 @@ //// [nullishCoalescingOperator_es2020.ts] -a1, a2, a3, a4, a5, a6, a7, a8, a9, (a ?? b) || c, c || (a ?? b), (a ?? b) || c, c || (a ?? b), (a ?? b) || c, c || (a ?? b), (a ?? b) && c, c && (a ?? b), (a ?? b) && c, c && (a ?? b), (a ?? b) && c, c && (a ?? b); diff --git a/crates/swc/tests/tsc-references/nullishCoalescingOperator_not_strict.2.minified.js b/crates/swc/tests/tsc-references/nullishCoalescingOperator_not_strict.2.minified.js index f5160d52c294a..f7a0e15b03e42 100644 --- a/crates/swc/tests/tsc-references/nullishCoalescingOperator_not_strict.2.minified.js +++ b/crates/swc/tests/tsc-references/nullishCoalescingOperator_not_strict.2.minified.js @@ -1,2 +1 @@ //// [nullishCoalescingOperator_not_strict.ts] -null != a1 && a1, null != a2 && a2, null != a3 && a3, null != a4 && a4, null != a5 && a5, null != a6 && a6, null != a7 && a7, null != a8 && a8, null != a9 && a9; diff --git a/crates/swc/tests/tsc-references/objectLiteralNormalization.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralNormalization.2.minified.js index 2a3a0b13f4181..2f9ed0576bb68 100644 --- a/crates/swc/tests/tsc-references/objectLiteralNormalization.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralNormalization.2.minified.js @@ -32,7 +32,7 @@ a2.a, a2.b, a2 = { var b2 = _object_spread_props(_object_spread({}, b1), { z: 55 }); -_object_spread({}, b2), opts; +_object_spread({}, b2); var d1_pos = { x: 0, y: 0 diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule.2.minified.js index 1074b036fe54a..4c7c44ed8d602 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModule.2.minified.js @@ -1,3 +1,3 @@ //// [objectLiteralShorthandPropertiesWithModule.ts] var m; -m || (m = {}), m || (m = {}), x, x, x; +m || (m = {}), m || (m = {}); diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6.2.minified.js index e3252d596ba23..cf6623b78a40d 100644 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6.2.minified.js +++ b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesWithModuleES6.2.minified.js @@ -1,3 +1,3 @@ //// [objectLiteralShorthandPropertiesWithModuleES6.ts] var m; -m || (m = {}), m || (m = {}), x, x, x; +m || (m = {}), m || (m = {}); diff --git a/crates/swc/tests/tsc-references/optionalChainingInTypeAssertions(target=esnext).2.minified.js b/crates/swc/tests/tsc-references/optionalChainingInTypeAssertions(target=esnext).2.minified.js index cada48ed12688..e0d585144fd74 100644 --- a/crates/swc/tests/tsc-references/optionalChainingInTypeAssertions(target=esnext).2.minified.js +++ b/crates/swc/tests/tsc-references/optionalChainingInTypeAssertions(target=esnext).2.minified.js @@ -2,4 +2,4 @@ const foo = new class { m() {} }(); -foo.m?.(), foo.m?.(), foo.m?.(), foo.m?.(), (foo?.m).length, (foo?.m).length, (foo?.m).length, (foo?.m).length; +(foo?.m).length, (foo?.m).length, (foo?.m).length, (foo?.m).length; diff --git a/crates/swc/tests/tsc-references/optionalPropertyAssignableToStringIndexSignature.2.minified.js b/crates/swc/tests/tsc-references/optionalPropertyAssignableToStringIndexSignature.2.minified.js index bb41f317fc4d7..b406d500263b9 100644 --- a/crates/swc/tests/tsc-references/optionalPropertyAssignableToStringIndexSignature.2.minified.js +++ b/crates/swc/tests/tsc-references/optionalPropertyAssignableToStringIndexSignature.2.minified.js @@ -1,2 +1,2 @@ //// [optionalPropertyAssignableToStringIndexSignature.ts] -stringDictionary = optionalProperties, stringDictionary = undefinedProperties, probablyArray = numberLiteralKeys, optionalUndefined; +stringDictionary = optionalProperties, stringDictionary = undefinedProperties, probablyArray = numberLiteralKeys; diff --git a/crates/swc/tests/tsc-references/override3.2.minified.js b/crates/swc/tests/tsc-references/override3.2.minified.js index 55da54a0bb97b..b5d56804f8f62 100644 --- a/crates/swc/tests/tsc-references/override3.2.minified.js +++ b/crates/swc/tests/tsc-references/override3.2.minified.js @@ -2,4 +2,3 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ B, /*#__PURE__*/ D, /*#__PURE__*/ D; diff --git a/crates/swc/tests/tsc-references/paramTagOnFunctionUsingArguments.2.minified.js b/crates/swc/tests/tsc-references/paramTagOnFunctionUsingArguments.2.minified.js index c8e6e261fd24d..b343df4903476 100644 --- a/crates/swc/tests/tsc-references/paramTagOnFunctionUsingArguments.2.minified.js +++ b/crates/swc/tests/tsc-references/paramTagOnFunctionUsingArguments.2.minified.js @@ -1,5 +1,2 @@ //// [decls.d.ts] //// [a.js] -!function() { - arguments; -}(1, 2, 3); diff --git a/crates/swc/tests/tsc-references/parenthesizedContexualTyping3.2.minified.js b/crates/swc/tests/tsc-references/parenthesizedContexualTyping3.2.minified.js index 5a3114d62d255..acdd105005877 100644 --- a/crates/swc/tests/tsc-references/parenthesizedContexualTyping3.2.minified.js +++ b/crates/swc/tests/tsc-references/parenthesizedContexualTyping3.2.minified.js @@ -1,5 +1 @@ //// [parenthesizedContexualTyping3.ts] -function tempFun(tempStrs, g, x) { - return g(x); -} -tempFun`${(x)=>x} ${10}`, tempFun`${(x)=>x} ${10}`, tempFun`${(x)=>x} ${10}`, tempFun`${(x)=>x} ${(x)=>x} ${10}`, tempFun`${(x)=>x} ${(x)=>x} ${10}`, tempFun`${(x)=>x} ${(x)=>x} ${10}`, tempFun`${(x)=>x} ${(x)=>x} ${10}`, tempFun`${(x)=>x} ${(x)=>x} ${void 0}`; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression10.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression10.2.minified.js index 55a0a8c14a76c..d91334412cdf0 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression10.2.minified.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression10.2.minified.js @@ -1,5 +1,3 @@ //// [parserArrowFunctionExpression10.ts] //// [fileJs.js] -a || ((e)=>f); //// [fileTs.ts] -a || ((e)=>f); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression12.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression12.2.minified.js index 3db81a70b4518..91b6aece1e3ac 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression12.2.minified.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression12.2.minified.js @@ -1,5 +1,3 @@ //// [parserArrowFunctionExpression12.ts] //// [fileJs.js] -a || ((d)=>e); //// [fileTs.ts] -a || ((d)=>e); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression13.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression13.2.minified.js index 1d58769947260..9179c10429096 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression13.2.minified.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression13.2.minified.js @@ -1,5 +1,3 @@ //// [parserArrowFunctionExpression13.ts] //// [fileJs.js] -a || (()=>null); //// [fileTs.ts] -a || (()=>null); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression14.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression14.2.minified.js index a5ac086615eac..5c5033e343c82 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression14.2.minified.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression14.2.minified.js @@ -1,5 +1,5 @@ //// [parserArrowFunctionExpression14.ts] //// [fileJs.js] -a() || e; +a(); //// [fileTs.ts] -a() || e; +a(); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression17.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression17.2.minified.js index 877ccd114c472..f2f2abfc3f6da 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression17.2.minified.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression17.2.minified.js @@ -1,5 +1,3 @@ //// [parserArrowFunctionExpression17.ts] //// [fileJs.js] -a && b; //// [fileTs.ts] -a && b; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression4.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression4.2.minified.js index f306350166260..454868b5dac40 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression4.2.minified.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression4.2.minified.js @@ -1,2 +1 @@ //// [parserArrowFunctionExpression4.ts] -a; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression8.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression8.2.minified.js index cf6b319eaf18c..e7e4a3432f7dc 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression8.2.minified.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression8.2.minified.js @@ -1,9 +1,3 @@ //// [parserArrowFunctionExpression8.ts] //// [fileJs.js] -x || ((z)=>({ - z - })); //// [fileTs.ts] -x || ((z)=>({ - z - })); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression9.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression9.2.minified.js index 93bd42f0712e7..fa91066ba36ad 100644 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression9.2.minified.js +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression9.2.minified.js @@ -1,5 +1,3 @@ //// [parserArrowFunctionExpression9.ts] //// [fileJs.js] -b && c; //// [fileTs.ts] -b && c; diff --git a/crates/swc/tests/tsc-references/parserCastVersusArrowFunction1.2.minified.js b/crates/swc/tests/tsc-references/parserCastVersusArrowFunction1.2.minified.js index cee01c882c08c..e7ba5c310084f 100644 --- a/crates/swc/tests/tsc-references/parserCastVersusArrowFunction1.2.minified.js +++ b/crates/swc/tests/tsc-references/parserCastVersusArrowFunction1.2.minified.js @@ -1,2 +1,2 @@ //// [parserCastVersusArrowFunction1.ts] -a, a, a, b, a = 1, b = 2; +a = 1, b = 2; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName12.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName12.2.minified.js index 92b1255439a62..43f5894868985 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName12.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName12.2.minified.js @@ -1,2 +1 @@ //// [parserComputedPropertyName12.ts] -e; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName17.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName17.2.minified.js index 1c3353c454690..a92a3734b0438 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName17.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName17.2.minified.js @@ -1,2 +1 @@ //// [parserComputedPropertyName17.ts] -e; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName2.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName2.2.minified.js index 210289737fb9e..79b8c809d0667 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName2.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName2.2.minified.js @@ -1,2 +1 @@ //// [parserComputedPropertyName2.ts] -e; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName24.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName24.2.minified.js index c62467bf98f2e..bac4b19457290 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName24.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName24.2.minified.js @@ -1,2 +1 @@ //// [parserComputedPropertyName24.ts] -e; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName3.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName3.2.minified.js index 97e2744587089..8cd2cc3e232a1 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName3.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName3.2.minified.js @@ -1,2 +1 @@ //// [parserComputedPropertyName3.ts] -e; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName4.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName4.2.minified.js index 1dab4aef5364c..e861cf539b91b 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName4.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName4.2.minified.js @@ -1,2 +1 @@ //// [parserComputedPropertyName4.ts] -e; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName40.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName40.2.minified.js index 79d38c168494c..6e6022c971306 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName40.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName40.2.minified.js @@ -1,2 +1 @@ //// [parserComputedPropertyName40.ts] -a; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName6.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName6.2.minified.js index 29c1cfe3b3a40..33e0342243e19 100644 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName6.2.minified.js +++ b/crates/swc/tests/tsc-references/parserComputedPropertyName6.2.minified.js @@ -1,2 +1 @@ //// [parserComputedPropertyName6.ts] -e, e, e; diff --git a/crates/swc/tests/tsc-references/parserConstructorAmbiguity1.2.minified.js b/crates/swc/tests/tsc-references/parserConstructorAmbiguity1.2.minified.js index e9ef9e169f858..bb842e87c3354 100644 --- a/crates/swc/tests/tsc-references/parserConstructorAmbiguity1.2.minified.js +++ b/crates/swc/tests/tsc-references/parserConstructorAmbiguity1.2.minified.js @@ -1,2 +1 @@ //// [parserConstructorAmbiguity1.ts] -A; diff --git a/crates/swc/tests/tsc-references/parserConstructorAmbiguity2.2.minified.js b/crates/swc/tests/tsc-references/parserConstructorAmbiguity2.2.minified.js index 908deedb28861..549badd80229a 100644 --- a/crates/swc/tests/tsc-references/parserConstructorAmbiguity2.2.minified.js +++ b/crates/swc/tests/tsc-references/parserConstructorAmbiguity2.2.minified.js @@ -1,2 +1 @@ //// [parserConstructorAmbiguity2.ts] -A; diff --git a/crates/swc/tests/tsc-references/parserConstructorAmbiguity4.2.minified.js b/crates/swc/tests/tsc-references/parserConstructorAmbiguity4.2.minified.js index f32f9459626e8..dd10c9811c62e 100644 --- a/crates/swc/tests/tsc-references/parserConstructorAmbiguity4.2.minified.js +++ b/crates/swc/tests/tsc-references/parserConstructorAmbiguity4.2.minified.js @@ -1,2 +1 @@ //// [parserConstructorAmbiguity4.ts] -new Date < A ? B : C; diff --git a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1.2.minified.js b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1.2.minified.js index 4787d0d0f8880..c3a5f4628aec5 100644 --- a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1.2.minified.js +++ b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts1.2.minified.js @@ -2,4 +2,3 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ A; diff --git a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2.2.minified.js b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2.2.minified.js index 74f96a2d15d7d..1ff2afde712f6 100644 --- a/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2.2.minified.js +++ b/crates/swc/tests/tsc-references/parserGenericsInTypeContexts2.2.minified.js @@ -2,4 +2,3 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ A; diff --git a/crates/swc/tests/tsc-references/parserIfStatement2.2.minified.js b/crates/swc/tests/tsc-references/parserIfStatement2.2.minified.js index 7e6d1cd4fe771..503ce357c9a08 100644 --- a/crates/swc/tests/tsc-references/parserIfStatement2.2.minified.js +++ b/crates/swc/tests/tsc-references/parserIfStatement2.2.minified.js @@ -1,2 +1 @@ //// [parserIfStatement2.ts] -a; diff --git a/crates/swc/tests/tsc-references/parserNoASIOnCallAfterFunctionExpression1.2.minified.js b/crates/swc/tests/tsc-references/parserNoASIOnCallAfterFunctionExpression1.2.minified.js index eb95c6999718f..a993444166bc4 100644 --- a/crates/swc/tests/tsc-references/parserNoASIOnCallAfterFunctionExpression1.2.minified.js +++ b/crates/swc/tests/tsc-references/parserNoASIOnCallAfterFunctionExpression1.2.minified.js @@ -1,2 +1,2 @@ //// [parserNoASIOnCallAfterFunctionExpression1.ts] -(void window).foo; +(void 0).foo; diff --git a/crates/swc/tests/tsc-references/parserNotRegex2.2.minified.js b/crates/swc/tests/tsc-references/parserNotRegex2.2.minified.js index 04f128ed61b25..905d76051b92b 100644 --- a/crates/swc/tests/tsc-references/parserNotRegex2.2.minified.js +++ b/crates/swc/tests/tsc-references/parserNotRegex2.2.minified.js @@ -1,2 +1,2 @@ //// [parserNotRegex2.ts] -A, B(C(), function() {}, function() {}); +B(C(), function() {}, function() {}); diff --git a/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity1.2.minified.js b/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity1.2.minified.js index df6a5f30b6379..995ba792bc353 100644 --- a/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity1.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity1.2.minified.js @@ -1,2 +1,2 @@ //// [parserRegularExpressionDivideAmbiguity1.ts] -notregexp, a.foo(); +a.foo(); diff --git a/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity2.2.minified.js b/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity2.2.minified.js index 23f5dec9e764d..e7a12911c9210 100644 --- a/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity2.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRegularExpressionDivideAmbiguity2.2.minified.js @@ -1,2 +1,2 @@ //// [parserRegularExpressionDivideAmbiguity2.ts] -notregexp, a.foo(); +a.foo(); diff --git a/crates/swc/tests/tsc-references/parserTernaryAndCommaOperators1.2.minified.js b/crates/swc/tests/tsc-references/parserTernaryAndCommaOperators1.2.minified.js index acf527081aec8..7258ff42d2fb0 100644 --- a/crates/swc/tests/tsc-references/parserTernaryAndCommaOperators1.2.minified.js +++ b/crates/swc/tests/tsc-references/parserTernaryAndCommaOperators1.2.minified.js @@ -1,2 +1,2 @@ //// [parserTernaryAndCommaOperators1.ts] -b.src, c && d; +b.src; diff --git a/crates/swc/tests/tsc-references/parserVariableDeclaration1.2.minified.js b/crates/swc/tests/tsc-references/parserVariableDeclaration1.2.minified.js index 7aca7722521ad..d33ab5fefabcf 100644 --- a/crates/swc/tests/tsc-references/parserVariableDeclaration1.2.minified.js +++ b/crates/swc/tests/tsc-references/parserVariableDeclaration1.2.minified.js @@ -1,2 +1 @@ //// [parserVariableDeclaration1.ts] -a, b, c, d; diff --git a/crates/swc/tests/tsc-references/privateNameStaticAccessorsCallExpression.2.minified.js b/crates/swc/tests/tsc-references/privateNameStaticAccessorsCallExpression.2.minified.js index 1f81e7ddbf7ec..ed0c19364a88d 100644 --- a/crates/swc/tests/tsc-references/privateNameStaticAccessorsCallExpression.2.minified.js +++ b/crates/swc/tests/tsc-references/privateNameStaticAccessorsCallExpression.2.minified.js @@ -8,7 +8,7 @@ class A { 1, 2 ]; - _class_static_private_field_spec_get(this, A, _fieldFunc2).call(A, 0, ...arr, 3), new (_class_static_private_field_spec_get(this, A, _fieldFunc2))(0, ...arr, 3), _class_static_private_field_spec_get(this, A, _fieldFunc2).bind(A)`head${1}middle${2}tail`, _class_static_private_field_spec_get(this.getClass(), A, _fieldFunc2).bind(A)`test${1}and${2}`; + _class_static_private_field_spec_get(this, A, _fieldFunc2).call(A, 0, ...arr, 3), new (_class_static_private_field_spec_get(this, A, _fieldFunc2))(0, ...arr, 3); } static getClass() { return A; diff --git a/crates/swc/tests/tsc-references/privateNameStaticMethodCallExpression.2.minified.js b/crates/swc/tests/tsc-references/privateNameStaticMethodCallExpression.2.minified.js index db697e2368a37..db9ad98ab8866 100644 --- a/crates/swc/tests/tsc-references/privateNameStaticMethodCallExpression.2.minified.js +++ b/crates/swc/tests/tsc-references/privateNameStaticMethodCallExpression.2.minified.js @@ -7,7 +7,7 @@ class AA { 1, 2 ]; - _class_static_private_method_get(AA, AA, method2).call(AA, 0, ...arr, 3), new (_class_static_private_method_get(AA, AA, method2))(0, ...arr, 3), _class_static_private_method_get(AA, AA, method2).bind(AA)`head${1}middle${2}tail`, _class_static_private_method_get(AA.getClass(), AA, method2).bind(AA)`test${1}and${2}`, _class_static_private_method_get(AA.getClass(), AA, method2).call(AA, 0, ...arr, 3), new (_class_static_private_method_get(AA.getClass(), AA, method2))(0, ...arr, 3), _class_static_private_method_get(AA.getClass(), AA, method2).bind(AA)`head${1}middle${2}tail`; + _class_static_private_method_get(AA, AA, method2).call(AA, 0, ...arr, 3), new (_class_static_private_method_get(AA, AA, method2))(0, ...arr, 3), _class_static_private_method_get(AA.getClass(), AA, method2).call(AA, 0, ...arr, 3), new (_class_static_private_method_get(AA.getClass(), AA, method2))(0, ...arr, 3); } static getClass() { return AA; diff --git a/crates/swc/tests/tsc-references/privateNamesUnique-4.2.minified.js b/crates/swc/tests/tsc-references/privateNamesUnique-4.2.minified.js index e600e270f4a2a..33eaf867f32af 100644 --- a/crates/swc/tests/tsc-references/privateNamesUnique-4.2.minified.js +++ b/crates/swc/tests/tsc-references/privateNamesUnique-4.2.minified.js @@ -1,3 +1,2 @@ //// [privateNamesUnique-4.ts] import "@swc/helpers/_/_class_private_field_init"; -a; diff --git a/crates/swc/tests/tsc-references/propertyOverridesAccessors4.2.minified.js b/crates/swc/tests/tsc-references/propertyOverridesAccessors4.2.minified.js index 1f308044e6631..f364ff27b8636 100644 --- a/crates/swc/tests/tsc-references/propertyOverridesAccessors4.2.minified.js +++ b/crates/swc/tests/tsc-references/propertyOverridesAccessors4.2.minified.js @@ -4,4 +4,3 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _define_property } from "@swc/helpers/_/_define_property"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ Animal; diff --git a/crates/swc/tests/tsc-references/reExportAliasMakesInstantiated.2.minified.js b/crates/swc/tests/tsc-references/reExportAliasMakesInstantiated.2.minified.js index ed95b9950d5e0..e8d055b4faaf3 100644 --- a/crates/swc/tests/tsc-references/reExportAliasMakesInstantiated.2.minified.js +++ b/crates/swc/tests/tsc-references/reExportAliasMakesInstantiated.2.minified.js @@ -1,3 +1,2 @@ //// [reExportAliasMakesInstantiated.ts] export var test1 = pack2.test1; -mod2; diff --git a/crates/swc/tests/tsc-references/spellingUncheckedJS.2.minified.js b/crates/swc/tests/tsc-references/spellingUncheckedJS.2.minified.js index 5ca6ff910f372..1dfe9c05513a4 100644 --- a/crates/swc/tests/tsc-references/spellingUncheckedJS.2.minified.js +++ b/crates/swc/tests/tsc-references/spellingUncheckedJS.2.minified.js @@ -11,6 +11,5 @@ var object = { }; object.spaaaace, object.spaace = 12, object.fresh = 12, other.puuuce, new Date().getGMTDate(), setIntegral(function() { return console.log('ok'); -}, 500), AudioBuffin, Jimmy, Jon; +}, 500); //// [other.js] -Jon; diff --git a/crates/swc/tests/tsc-references/stringLiteralTypesAndParenthesizedExpressions01.2.minified.js b/crates/swc/tests/tsc-references/stringLiteralTypesAndParenthesizedExpressions01.2.minified.js index 7e04f3182beea..796eea6ff2f38 100644 --- a/crates/swc/tests/tsc-references/stringLiteralTypesAndParenthesizedExpressions01.2.minified.js +++ b/crates/swc/tests/tsc-references/stringLiteralTypesAndParenthesizedExpressions01.2.minified.js @@ -1,2 +1 @@ //// [stringLiteralTypesAndParenthesizedExpressions01.ts] -myRandBool, myRandBool; diff --git a/crates/swc/tests/tsc-references/taggedTemplateContextualTyping1.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateContextualTyping1.2.minified.js index cd79beb835555..32219027fdfec 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateContextualTyping1.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateContextualTyping1.2.minified.js @@ -1,3 +1 @@ //// [taggedTemplateContextualTyping1.ts] -function tempTag1(...rest) {} -tempTag1`${(x)=>(x(void 0), x)}${10}`, tempTag1`${(x)=>(x(void 0), x)}${(y)=>(y(void 0), y)}${10}`, tempTag1`${(x)=>(x(void 0), x)}${(y)=>(y(void 0), y)}${void 0}`, tempTag1`${(x)=>(x(void 0), x)}${(y)=>(y(void 0), y)}${void 0}`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateContextualTyping2.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateContextualTyping2.2.minified.js index e1ad45b0a0bd7..47cff9fad2764 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateContextualTyping2.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateContextualTyping2.2.minified.js @@ -1,3 +1 @@ //// [taggedTemplateContextualTyping2.ts] -function tempTag2(...rest) {} -tempTag2`${(x)=>(x(void 0), x)}${0}`, tempTag2`${(x)=>(x(void 0), x)}${(y)=>(y(null), y)}${"hello"}`, tempTag2`${(x)=>(x(void 0), x)}${void 0}${"hello"}`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6.2.minified.js index 107cc5d0286b2..aa9f90dceb655 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6.2.minified.js @@ -1,2 +1 @@ //// [taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6.ts] -(function(...x) {})`0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.2.minified.js index 021d3f9487402..2bfcfe125f65c 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.2.minified.js @@ -1,2 +1 @@ //// [taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.ts] -(function(...x) {})`0${" "}1${" "}2${" "}3${" "}4${" "}5${" "}6${" "}7${" "}8${" "}9${" "}10${" "}11${" "}12${" "}13${" "}14${" "}15${" "}16${" "}17${" "}18${" "}19${" "}20${" "}2028${" "}2029${" "}0085${" "}t${" "}v${" "}f${" "}b${" "}r${" "}n`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6.2.minified.js index 5a09b327ba02d..1f529686414d7 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6.2.minified.js @@ -1,26 +1 @@ //// [taggedTemplateStringsTypeArgumentInferenceES6.ts] -function someGenerics3(strs, producer) {} -function someGenerics4(strs, n, f) {} -function someGenerics5(strs, n, f) {} -function someGenerics6(strs, a, b, c) {} -function someGenerics7(strs, a, b, c) {} -someGenerics3`${()=>''}`, someGenerics3`${()=>void 0}`, someGenerics3`${()=>3}`, someGenerics4`${4}${()=>null}`, someGenerics4`${''}${()=>3}`, someGenerics4`${null}${null}`, someGenerics5`${4} ${()=>null}`, someGenerics5`${''}${()=>3}`, someGenerics5`${null}${null}`, someGenerics6`${(n)=>n}${(n)=>n}${(n)=>n}`, someGenerics6`${(n)=>n}${(n)=>n}${(n)=>n}`, someGenerics6`${(n)=>n}${(n)=>n}${(n)=>n}`, someGenerics7`${(n)=>n}${(n)=>n}${(n)=>n}`, someGenerics7`${(n)=>n}${(n)=>n}${(n)=>n}`, someGenerics7`${(n)=>n}${(n)=>n}${(n)=>n}`; -var anyVar, x = (function(strs, n) { - return n; -})`${someGenerics7}`; -function someGenerics9(strs, a, b, c) { - return null; -} -x`${null}${null}${null}`, someGenerics9`${''}${0}${[]}`, someGenerics9`${void 0}${{ - x: 6, - z: new Date() -}}${{ - x: 6, - y: '' -}}`, someGenerics9`${{ - x: 3 -}}${{ - x: 6 -}}${{ - x: 6 -}}`, someGenerics9`${7}${anyVar}${4}`, someGenerics9`${[]}${null}${void 0}`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithIncompatibleTypedTagsES6.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithIncompatibleTypedTagsES6.2.minified.js index dc78cbc526c39..41c0283968e07 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithIncompatibleTypedTagsES6.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithIncompatibleTypedTagsES6.2.minified.js @@ -1,3 +1,3 @@ //// [taggedTemplateStringsWithIncompatibleTypedTagsES6.ts] var f; -f`abc`, f`abc${1}def${2}ghi`, f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`[0].member`abc${1}def${2}ghi`, f`abc${1}def${2}ghi`.member.member`abc${1}def${2}ghi`, f`abc${!0}def${!0}ghi`.member.member`abc${1}def${2}ghi`, f.thisIsNotATag("abc"), f.thisIsNotATag("abc1def2ghi"); +f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`.member, f`abc${1}def${2}ghi`.member, f.thisIsNotATag("abc"), f.thisIsNotATag("abc1def2ghi"); diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_ES6.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_ES6.2.minified.js index d874398581de2..c5ddb490afe28 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_ES6.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_ES6.2.minified.js @@ -1,3 +1 @@ //// [taggedTemplateStringsWithOverloadResolution1_ES6.ts] -function foo(...stuff) {} -foo``, foo`${1}`, foo`${1}${2}`, foo`${1}${!0}`, foo`${1}${"2"}`, foo`${1}${2}${3}`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution2_ES6.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution2_ES6.2.minified.js index f05dca5c4bc40..b7294d1ff9c8e 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution2_ES6.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution2_ES6.2.minified.js @@ -1,2 +1 @@ //// [taggedTemplateStringsWithOverloadResolution2_ES6.ts] -(function(...stuff) {})`${1}`, (function(...stuff) {})`${1}`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6.2.minified.js index fbf6db6e3fbc4..1b64b81830c49 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6.2.minified.js @@ -1,13 +1,4 @@ //// [taggedTemplateStringsWithOverloadResolution3_ES6.ts] -function fn1() { - return null; -} function fn2() {} -fn1`${void 0}`, fn1`${{}}`; var d1 = fn2`${0}${void 0}`, d2 = fn2`${0}${void 0}`; -function fn3() { - return null; -} -function fn4() {} -function fn5() {} -d1.foo(), d2(), fn2`${0}${''}`, fn2`${''}${0}`, fn3`${3}`, fn3`${''}${3}${''}`, fn3`${5}${5}${5}`, fn3`${4}`, fn3`${''}${''}${''}`, fn3`${''}${''}${3}`, fn3``, fn4`${''}${3}`, fn4`${3}${''}`, fn4`${3}${void 0}`, fn4`${''}${null}`, fn4`${null}${null}`, fn4`${!0}${null}`, fn4`${null}${!0}`, fn5`${(n)=>n.toFixed()}`, fn5`${(n)=>n.substr(0)}`; +d1.foo(), d2(); diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclareES6.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclareES6.2.minified.js index c7a34b7b344d5..8d973f2db6445 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclareES6.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagNamedDeclareES6.2.minified.js @@ -1,2 +1 @@ //// [taggedTemplateStringsWithTagNamedDeclareES6.ts] -(function(x, ...ys) {})`Hello ${0} world!`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagsTypedAsAnyES6.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagsTypedAsAnyES6.2.minified.js index b1c92fe3cee9e..ec2df32387e0a 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagsTypedAsAnyES6.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTagsTypedAsAnyES6.2.minified.js @@ -1,3 +1,3 @@ //// [taggedTemplateStringsWithTagsTypedAsAnyES6.ts] var f; -f`abc`, f`abc${1}def${2}ghi`, f.g.h`abc`, f.g.h`abc${1}def${2}ghi`, f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`.member.someOtherTag`abc${1}def${2}ghi`, f`abc${1}def${2}ghi`.member.someOtherTag`abc${1}def${2}ghi`, f.thisIsNotATag("abc"), f.thisIsNotATag("abc1def2ghi"); +f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`.member, f`abc${1}def${2}ghi`.member, f.thisIsNotATag("abc"), f.thisIsNotATag("abc1def2ghi"); diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.2.minified.js index 1f2d8f7c6d8ef..98c6aba33d5d9 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.2.minified.js @@ -1,2 +1 @@ //// [taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts] -(function(...rest) {})`${function(x) {}}`; diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypedTagsES6.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypedTagsES6.2.minified.js index 80795fe03d6bd..8b4de6d58533b 100644 --- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypedTagsES6.2.minified.js +++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypedTagsES6.2.minified.js @@ -1,3 +1,3 @@ //// [taggedTemplateStringsWithTypedTagsES6.ts] var f; -f`abc`, f`abc${1}def${2}ghi`, f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`[0].member`abc${1}def${2}ghi`, f`abc${1}def${2}ghi`.member.member`abc${1}def${2}ghi`, f.thisIsNotATag("abc"), f.thisIsNotATag("abc1def2ghi"); +f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`.member, f`abc${1}def${2}ghi`.member, f.thisIsNotATag("abc"), f.thisIsNotATag("abc1def2ghi"); diff --git a/crates/swc/tests/tsc-references/templateLiteralTypes5.2.minified.js b/crates/swc/tests/tsc-references/templateLiteralTypes5.2.minified.js index 51dc93488a5d9..08c6af7b0b1d7 100644 --- a/crates/swc/tests/tsc-references/templateLiteralTypes5.2.minified.js +++ b/crates/swc/tests/tsc-references/templateLiteralTypes5.2.minified.js @@ -1,2 +1 @@ //// [templateLiteralTypes5.ts] -f, f; diff --git a/crates/swc/tests/tsc-references/templateLiteralTypes7.2.minified.js b/crates/swc/tests/tsc-references/templateLiteralTypes7.2.minified.js index f1f19ee7a0f95..ec9278a2244e4 100644 --- a/crates/swc/tests/tsc-references/templateLiteralTypes7.2.minified.js +++ b/crates/swc/tests/tsc-references/templateLiteralTypes7.2.minified.js @@ -1,2 +1 @@ //// [templateLiteralTypes7.ts] -g, g, g; diff --git a/crates/swc/tests/tsc-references/templateStringInTaggedTemplateES6.2.minified.js b/crates/swc/tests/tsc-references/templateStringInTaggedTemplateES6.2.minified.js index df6d8f73146b9..1861fb2235799 100644 --- a/crates/swc/tests/tsc-references/templateStringInTaggedTemplateES6.2.minified.js +++ b/crates/swc/tests/tsc-references/templateStringInTaggedTemplateES6.2.minified.js @@ -1,2 +1 @@ //// [templateStringInTaggedTemplateES6.ts] -"I AM THE TAG PORTION"`I ${"AM"} THE TEMPLATE PORTION`; diff --git a/crates/swc/tests/tsc-references/thisTypeInFunctions3.2.minified.js b/crates/swc/tests/tsc-references/thisTypeInFunctions3.2.minified.js index 96f0c388f2b05..0627827a33d2d 100644 --- a/crates/swc/tests/tsc-references/thisTypeInFunctions3.2.minified.js +++ b/crates/swc/tests/tsc-references/thisTypeInFunctions3.2.minified.js @@ -2,4 +2,3 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ Base; diff --git a/crates/swc/tests/tsc-references/thisTypeInTaggedTemplateCall.2.minified.js b/crates/swc/tests/tsc-references/thisTypeInTaggedTemplateCall.2.minified.js index 268030e70a50e..4099a301e1bed 100644 --- a/crates/swc/tests/tsc-references/thisTypeInTaggedTemplateCall.2.minified.js +++ b/crates/swc/tests/tsc-references/thisTypeInTaggedTemplateCall.2.minified.js @@ -4,4 +4,3 @@ class Foo { return new this(); } } -Foo.m`test`, Foo.m`test`; diff --git a/crates/swc/tests/tsc-references/topLevelThisAssignment.2.minified.js b/crates/swc/tests/tsc-references/topLevelThisAssignment.2.minified.js index 90b51c3d99cee..91ed36e85c628 100644 --- a/crates/swc/tests/tsc-references/topLevelThisAssignment.2.minified.js +++ b/crates/swc/tests/tsc-references/topLevelThisAssignment.2.minified.js @@ -1,4 +1,4 @@ //// [a.js] -this.a = 10, this.a, a; +this.a = 10, this.a; //// [b.js] -this.a, a; +this.a; diff --git a/crates/swc/tests/tsc-references/tsxEmit3.2.minified.js b/crates/swc/tests/tsc-references/tsxEmit3.2.minified.js index 3ef2627644712..44a673f0dceef 100644 --- a/crates/swc/tests/tsc-references/tsxEmit3.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxEmit3.2.minified.js @@ -5,4 +5,4 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; _class_call_check(this, Foo1); }, (M1.S || (M1.S = {})).Bar = function Bar1() { _class_call_check(this, Bar1); -}, Foo, /*#__PURE__*/ Foo, (M2 = M || (M = {})).S || (M2.S = {}), Foo, /*#__PURE__*/ Foo, Bar, /*#__PURE__*/ Bar, M || (M = {}), S.Bar, /*#__PURE__*/ S.Bar, M || (M = {}), Foo, /*#__PURE__*/ Foo; +}, (M2 = M || (M = {})).S || (M2.S = {}), M || (M = {}), S.Bar, /*#__PURE__*/ S.Bar, M || (M = {}); diff --git a/crates/swc/tests/tsc-references/tsxExternalModuleEmit2.2.minified.js b/crates/swc/tests/tsc-references/tsxExternalModuleEmit2.2.minified.js index 5251a64c99693..56b2a19beff8b 100644 --- a/crates/swc/tests/tsc-references/tsxExternalModuleEmit2.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxExternalModuleEmit2.2.minified.js @@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", { value: !0 }); var _mod = /*#__PURE__*/ require("@swc/helpers/_/_interop_require_default")._(require("mod")); -Foo, _mod.default, Foo, _mod.default; +_mod.default, _mod.default; diff --git a/crates/swc/tests/tsc-references/tsxPreserveEmit1.2.minified.js b/crates/swc/tests/tsc-references/tsxPreserveEmit1.2.minified.js index 6e29cf55e39a8..c30a225b0afef 100644 --- a/crates/swc/tests/tsc-references/tsxPreserveEmit1.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxPreserveEmit1.2.minified.js @@ -16,5 +16,5 @@ define([ var M; Object.defineProperty(exports, "__esModule", { value: !0 - }), _reactrouter.Route, M || (M = {}), M || (M = {}), /*#__PURE__*/ X; + }), _reactrouter.Route, M || (M = {}), M || (M = {}); }); diff --git a/crates/swc/tests/tsc-references/tsxReactEmit3.2.minified.js b/crates/swc/tests/tsc-references/tsxReactEmit3.2.minified.js index 66caa74c7ed74..6af6d9beba8f0 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmit3.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxReactEmit3.2.minified.js @@ -1,2 +1 @@ //// [test.tsx] -/*#__PURE__*/ Foo, /*#__PURE__*/ Bar, /*#__PURE__*/ Bar, /*#__PURE__*/ Bar, /*#__PURE__*/ Bar; diff --git a/crates/swc/tests/tsc-references/tsxReactEmit4.2.minified.js b/crates/swc/tests/tsc-references/tsxReactEmit4.2.minified.js index 85f45c7a791a6..893a0236f7f09 100644 --- a/crates/swc/tests/tsc-references/tsxReactEmit4.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxReactEmit4.2.minified.js @@ -2,6 +2,6 @@ var p; import { _ as _object_spread } from "@swc/helpers/_/_object_spread"; import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props"; -/*#__PURE__*/ blah, /*#__PURE__*/ _object_spread_props(_object_spread({}, p), { +/*#__PURE__*/ _object_spread_props(_object_spread({}, p), { x: 0 }); diff --git a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17.2.minified.js b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17.2.minified.js index c49ae5d65a1bf..28b4d00066b48 100644 --- a/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxSpreadAttributesResolution17.2.minified.js @@ -12,4 +12,3 @@ export var Empty = /*#__PURE__*/ function(_React_Component) { return /*#__PURE__*/ React.createElement("div", null, "Hello"); }, Empty; }(React.Component); -/*#__PURE__*/ obj; diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload1.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload1.2.minified.js index 97fedaf3801d4..7657cb32d1066 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload1.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload1.2.minified.js @@ -6,5 +6,5 @@ define([ ], function(require, exports, _react) { Object.defineProperty(exports, "__esModule", { value: !0 - }), /*#__PURE__*/ OneThing, /*#__PURE__*/ OneThing, /*#__PURE__*/ OneThing, /*#__PURE__*/ OneThing, /*#__PURE__*/ OneThing, /*#__PURE__*/ TestingOneThing, /*#__PURE__*/ TestingOneThing, /*#__PURE__*/ TestingOneThing, /*#__PURE__*/ TestingOneThing, /*#__PURE__*/ TestingOneThing, /*#__PURE__*/ TestingOptional, /*#__PURE__*/ TestingOptional, /*#__PURE__*/ TestingOptional, /*#__PURE__*/ TestingOptional, /*#__PURE__*/ TestingOptional, /*#__PURE__*/ TestingOptional; + }); }); diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2.2.minified.js index fcf160ea7fc70..690433aa6fa1a 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload2.2.minified.js @@ -15,15 +15,15 @@ define([ }, obj1 = { yy: !0 }; - /*#__PURE__*/ OneThing, /*#__PURE__*/ OneThing, /*#__PURE__*/ OneThing, OneThing, _object_spread._({}, obj1, obj), OneThing, _object_spread_props._(_object_spread._({}, obj1), { + _object_spread._({}, obj1, obj), _object_spread_props._(_object_spread._({}, obj1), { yy: 42, yy1: "hi" - }), OneThing, _object_spread_props._(_object_spread._({}, obj1), { + }), _object_spread_props._(_object_spread._({}, obj1), { yy: 10000, yy1: "true" - }), OneThing, _object_spread._(_object_spread_props._(_object_spread._({}, defaultObj), { + }), _object_spread._(_object_spread_props._(_object_spread._({}, defaultObj), { yy: !0 - }), obj), /*#__PURE__*/ OneThing, /*#__PURE__*/ OneThing, OneThing, _object_spread_props._(_object_spread._({}, { + }), obj), _object_spread_props._(_object_spread._({}, { yy: 500, "ignore-prop": "hello" }), { diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3.2.minified.js index 47ab83468ee1f..e8c37d6369fd4 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload3.2.minified.js @@ -8,11 +8,11 @@ define([ var obj2; Object.defineProperty(exports, "__esModule", { value: !0 - }), /*#__PURE__*/ ZeroThingOrTwoThing, /*#__PURE__*/ ZeroThingOrTwoThing, /*#__PURE__*/ ZeroThingOrTwoThing, ZeroThingOrTwoThing, _object_spread._({ + }), _object_spread._({ yy: 1000 - }, obj2), ZeroThingOrTwoThing, _object_spread_props._(_object_spread._({}, obj2), { + }, obj2), _object_spread_props._(_object_spread._({}, obj2), { yy: 1000 - }), /*#__PURE__*/ ThreeThing, /*#__PURE__*/ ThreeThing, ThreeThing, _object_spread_props._(_object_spread._({}, obj2), { + }), _object_spread_props._(_object_spread._({}, obj2), { y2: 10 }); }); diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4.2.minified.js index 964e68a5f4c12..52268d717efb9 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentOverload4.2.minified.js @@ -13,17 +13,17 @@ define([ yy: 10, yy1: "hello" }; - /*#__PURE__*/ OneThing, /*#__PURE__*/ OneThing, OneThing, _object_spread_props._(_object_spread._({}, obj), { + _object_spread_props._(_object_spread._({}, obj), { yy1: !0 - }), OneThing, _object_spread_props._(_object_spread._({}, obj), { + }), _object_spread_props._(_object_spread._({}, obj), { extra: "extra attr" - }), OneThing, _object_spread_props._(_object_spread._({}, obj), { + }), _object_spread_props._(_object_spread._({}, obj), { y1: 10000 - }), OneThing, _object_spread_props._(_object_spread._({}, obj), { + }), _object_spread_props._(_object_spread._({}, obj), { yy: !0 - }), OneThing, _object_spread_props._(_object_spread._({}, obj2), { + }), _object_spread_props._(_object_spread._({}, obj2), { extra: "extra attr" - }), OneThing, _object_spread_props._(_object_spread._({}, obj2), { + }), _object_spread_props._(_object_spread._({}, obj2), { yy: !0 - }), /*#__PURE__*/ TestingOneThing, /*#__PURE__*/ TestingOneThing, /*#__PURE__*/ TestingOptional, /*#__PURE__*/ TestingOptional, /*#__PURE__*/ TestingOptional, /*#__PURE__*/ TestingOptional; + }); }); diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1.2.minified.js index beeccc705c0de..7657cb32d1066 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments1.2.minified.js @@ -6,5 +6,5 @@ define([ ], function(require, exports, _react) { Object.defineProperty(exports, "__esModule", { value: !0 - }), /*#__PURE__*/ InferParamComponent; + }); }); diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2.2.minified.js index 76fcb201a7711..1af4b0e0572b7 100644 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2.2.minified.js +++ b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponentsWithTypeArguments2.2.minified.js @@ -8,5 +8,5 @@ define([ ], function(require, exports, _object_spread, _object_spread_props, _react) { Object.defineProperty(exports, "__esModule", { value: !0 - }), /*#__PURE__*/ InferParamComponent; + }); }); diff --git a/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints.2.minified.js b/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints.2.minified.js index aa116787d1512..86ba5d1045e26 100644 --- a/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints.2.minified.js +++ b/crates/swc/tests/tsc-references/typeArgumentInferenceWithConstraints.2.minified.js @@ -1,2 +1 @@ //// [typeArgumentInferenceWithConstraints.ts] -window, window; diff --git a/crates/swc/tests/tsc-references/typeParameterAsBaseType.2.minified.js b/crates/swc/tests/tsc-references/typeParameterAsBaseType.2.minified.js index 977848ea82451..a5ab7fdc7c974 100644 --- a/crates/swc/tests/tsc-references/typeParameterAsBaseType.2.minified.js +++ b/crates/swc/tests/tsc-references/typeParameterAsBaseType.2.minified.js @@ -2,4 +2,3 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check"; import { _ as _inherits } from "@swc/helpers/_/_inherits"; import { _ as _create_super } from "@swc/helpers/_/_create_super"; -/*#__PURE__*/ T, /*#__PURE__*/ U; diff --git a/crates/swc/tests/tsc-references/uniqueSymbols.2.minified.js b/crates/swc/tests/tsc-references/uniqueSymbols.2.minified.js index 150c1384a4b51..aacb725791f3e 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbols.2.minified.js +++ b/crates/swc/tests/tsc-references/uniqueSymbols.2.minified.js @@ -1,6 +1,6 @@ //// [uniqueSymbols.ts] const constCall = Symbol(); -Symbol(), Symbol(), Symbol(), constType, constType, constType, constType; +Symbol(), Symbol(), Symbol(); class C { static{ this.readonlyStaticCall = Symbol(); @@ -15,7 +15,7 @@ class C { this.readonlyCall = Symbol(), this.readwriteCall = Symbol(); } } -C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, i.readonlyType, i.readonlyType, i.readonlyType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, Promise.resolve(constCall), f(s), f(N.s), f(N.s), s, N.s, N.s, s, N.s, N.s, (p = s)=>p; +C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, i.readonlyType, i.readonlyType, i.readonlyType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, Promise.resolve(constCall), f(s), f(N.s), f(N.s), N.s, N.s, N.s, N.s; class C0 { static{ this.a = s; @@ -54,7 +54,7 @@ class C0 { this.a = s, this.b = N.s, this.c = N.s, this.d = s, this.e = N.s, this.f = N.s; } } -o[s], o[N.s], o[N.s], f(s), f(N.s), f(N.s), g(s), g(N.s), g(N.s), s, N.s, N.s, 2 * Math.random() && s, 2 * Math.random() && N.s, 2 * Math.random() && N.s, s, N.s; +o[s], o[N.s], o[N.s], f(s), f(N.s), f(N.s), g(s), g(N.s), g(N.s), N.s, N.s, 2 * Math.random() && N.s, 2 * Math.random() && N.s, N.s; class C1 { static{ N.s, N.s; diff --git a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations.2.minified.js b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations.2.minified.js index 3cd9279083caa..79ce7d8f9097b 100644 --- a/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations.2.minified.js +++ b/crates/swc/tests/tsc-references/uniqueSymbolsDeclarations.2.minified.js @@ -1,6 +1,6 @@ //// [uniqueSymbolsDeclarations.ts] const constCall = Symbol(); -Symbol(), Symbol(), Symbol(), constType, constType, constType, constType; +Symbol(), Symbol(), Symbol(); class C { static{ this.readonlyStaticCall = Symbol(); @@ -15,7 +15,7 @@ class C { this.readonlyCall = Symbol(), this.readwriteCall = Symbol(); } } -C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, i.readonlyType, i.readonlyType, i.readonlyType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, Promise.resolve(constCall), f(s), f(N.s), f(N.s), s, N.s, N.s, s, N.s, N.s, (p = s)=>p; +C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, C.readonlyStaticCall, C.readonlyStaticType, C.readonlyStaticTypeAndCall, C.readwriteStaticCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, c.readonlyCall, c.readwriteCall, i.readonlyType, i.readonlyType, i.readonlyType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, l.readonlyType, l.nested.readonlyNestedType, Promise.resolve(constCall), f(s), f(N.s), f(N.s), N.s, N.s, N.s, N.s; class C0 { static{ this.a = s; @@ -54,7 +54,7 @@ class C0 { this.a = s, this.b = N.s, this.c = N.s, this.d = s, this.e = N.s, this.f = N.s; } } -o[s], o[N.s], o[N.s], f(s), f(N.s), f(N.s), g(s), g(N.s), g(N.s), s, N.s, N.s, 2 * Math.random() && s, 2 * Math.random() && N.s, 2 * Math.random() && N.s, s, N.s; +o[s], o[N.s], o[N.s], f(s), f(N.s), f(N.s), g(s), g(N.s), g(N.s), N.s, N.s, 2 * Math.random() && N.s, 2 * Math.random() && N.s, N.s; class C1 { static{ N.s, N.s; diff --git a/crates/swc/tests/tsc-references/unknownType2.2.minified.js b/crates/swc/tests/tsc-references/unknownType2.2.minified.js index fee503939e9e8..2e6c8cf225701 100644 --- a/crates/swc/tests/tsc-references/unknownType2.2.minified.js +++ b/crates/swc/tests/tsc-references/unknownType2.2.minified.js @@ -1,3 +1,3 @@ //// [unknownType2.ts] var NumberEnum, StringEnum, NumberEnum1, StringEnum1, u = void 0; -5 === u && u.toString(10), symb, aString, aBoolean, aNumber, anObject, anObjectLiteral, aUnion, anIntersection, aFunction, (NumberEnum = NumberEnum1 || (NumberEnum1 = {}))[NumberEnum.A = 0] = "A", NumberEnum[NumberEnum.B = 1] = "B", NumberEnum[NumberEnum.C = 2] = "C", (StringEnum = StringEnum1 || (StringEnum1 = {})).A = "A", StringEnum.B = "B", StringEnum.C = "C"; +5 === u && u.toString(10), (NumberEnum = NumberEnum1 || (NumberEnum1 = {}))[NumberEnum.A = 0] = "A", NumberEnum[NumberEnum.B = 1] = "B", NumberEnum[NumberEnum.C = 2] = "C", (StringEnum = StringEnum1 || (StringEnum1 = {})).A = "A", StringEnum.B = "B", StringEnum.C = "C"; diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxInternalImportEquals.2.minified.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxInternalImportEquals.2.minified.js index 40fde832d6b9d..87ec44b4a0847 100644 --- a/crates/swc/tests/tsc-references/verbatimModuleSyntaxInternalImportEquals.2.minified.js +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxInternalImportEquals.2.minified.js @@ -1,4 +1,4 @@ //// [verbatimModuleSyntaxInternalImportEquals.ts] var Foo; -NonExistent, (Foo || (Foo = {})).foo = 1, Foo.foo, Foo.T; +(Foo || (Foo = {})).foo = 1, Foo.foo, Foo.T; export { }; diff --git a/crates/swc/tests/tsc-references/voidParamAssignmentCompatibility.2.minified.js b/crates/swc/tests/tsc-references/voidParamAssignmentCompatibility.2.minified.js index 5e082d3ef6ca9..354423dcfdc52 100644 --- a/crates/swc/tests/tsc-references/voidParamAssignmentCompatibility.2.minified.js +++ b/crates/swc/tests/tsc-references/voidParamAssignmentCompatibility.2.minified.js @@ -1,2 +1,2 @@ //// [voidParamAssignmentCompatibility.ts] -g, o.method; +o.method; diff --git a/crates/swc/tests/vercel/full/next-31419/2/output/index.js b/crates/swc/tests/vercel/full/next-31419/2/output/index.js index 77b744e04916d..bec0cedaac40e 100644 --- a/crates/swc/tests/vercel/full/next-31419/2/output/index.js +++ b/crates/swc/tests/vercel/full/next-31419/2/output/index.js @@ -3,7 +3,7 @@ import { _ as r } from "@swc/helpers/_/_async_to_generator"; Promise.all(assignAll).then((e = r(function*(e) { for(let e in obj){ let r = obj[e]; - r.id, (yield listOfUser(r.id)).forEach((e)=>{ + (yield listOfUser(r.id)).forEach((e)=>{ insertQuery += `INSERT INTO "TABLE"("UUID", id, other_ids_here) VALUES ('${uuidv4()}', '${r.id}', now());`; }); } diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/6146/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/6146/output.js index 4dc21d51f8068..e69de29bb2d1d 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/6146/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/6146/output.js @@ -1,6 +0,0 @@ -let o = { - f () { - assert.ok(this !== o); - } -}; -(0, o.f)``; diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/6175/1/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/6175/1/output.js index a892d4e02bb28..e69de29bb2d1d 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/6175/1/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/6175/1/output.js @@ -1,6 +0,0 @@ -let o = { - f () { - assert.ok(this !== o); - } -}; -(0, o.f)``, (0, o.f)``, (0, o.f)``, (0, o.f)``; diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/6636/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/6636/output.js index 16e888beb4db7..5f35c837cde1a 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/6636/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/6636/output.js @@ -1,4 +1,4 @@ export function memo(fn, opts) { let result; - return ()=>(result = fn(...newDeps), opts?.onChange?.(result), result); + return ()=>result = fn(...newDeps); } diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8737/2/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/8737/2/output.js index bb0fd3bbeaa51..543bcae0320bb 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/8737/2/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8737/2/output.js @@ -1,6 +1,6 @@ d(function() { var b = function() { - return a, "some string"; + return "some string"; }; return function() { return b; diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8737/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/8737/output.js index 2d9886ffdc7f4..b92715a6625e6 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/8737/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8737/output.js @@ -1,6 +1,6 @@ d(()=>{ var obj = { key: "some string" - }, b = ()=>(a, obj.key); + }, b = ()=>obj.key; return ()=>b; }); diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8844/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/8844/output.js index a6899ca3223ae..e69de29bb2d1d 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/8844/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8844/output.js @@ -1,2 +0,0 @@ -let x; -x?.x?.(); diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8974/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/8974/output.js index 054e52a677c0b..2234b9cae16d6 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/8974/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8974/output.js @@ -1,7 +1 @@ -const one = { - kind: "Document", - definitions: [], - loc: {} -}; -one.definitions, a`${one}`; export { }; diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/vercel/007/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/vercel/007/output.js index e941547337f69..a7955dbf1b96c 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/vercel/007/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/vercel/007/output.js @@ -9,7 +9,7 @@ import _JSXStyle from "styled-jsx/style"; top ? "column" : "column-reverse" ] ] - ]), /*#__PURE__*/ Sidebar, /*#__PURE__*/ _JSXStyle.dynamic([ + ]), /*#__PURE__*/ _JSXStyle.dynamic([ [ "4507deac72c40d6c", [ diff --git a/crates/swc_ecma_minifier/tests/fixture/member_expr/callee/output.js b/crates/swc_ecma_minifier/tests/fixture/member_expr/callee/output.js index 089d30f038511..e69de29bb2d1d 100644 --- a/crates/swc_ecma_minifier/tests/fixture/member_expr/callee/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/member_expr/callee/output.js @@ -1,5 +0,0 @@ -try { - ({}).bar.baz?.(); -} catch (e) { - console.log('PASS'); -} diff --git a/crates/swc_ecma_minifier/tests/fixture/next/tinymce/1/output.js b/crates/swc_ecma_minifier/tests/fixture/next/tinymce/1/output.js index 5169b2e043fe7..f93c94d778a68 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/tinymce/1/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/tinymce/1/output.js @@ -1,12 +1 @@ -Yp.revoke, (a)=>Yp.config({ - aria: { - mode: "checked" - }, - ...ge(a, (e, t)=>"exclusive" !== t), - onToggled: (c, d)=>{ - p(a.onToggled) && a.onToggled(c, d), Or(c, th, { - item: c, - state: d - }); - } - }); +Yp.revoke; diff --git a/crates/swc_ecma_minifier/tests/full/feedback-mapbox/785-e1932cc99ac3bb67/output.js b/crates/swc_ecma_minifier/tests/full/feedback-mapbox/785-e1932cc99ac3bb67/output.js index a899c5a1e16b4..e07f4fffca51c 100644 --- a/crates/swc_ecma_minifier/tests/full/feedback-mapbox/785-e1932cc99ac3bb67/output.js +++ b/crates/swc_ecma_minifier/tests/full/feedback-mapbox/785-e1932cc99ac3bb67/output.js @@ -929,7 +929,7 @@ if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(func ["observe","unobserve","disconnect"].forEach(function(t){ta.prototype[t]=function(){var e;return(e=to.get(this))[t].apply(e,arguments)}});var ts=// Export existing implementation if available. void 0!==q.ResizeObserver?q.ResizeObserver:ta;function tc(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js function tu(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o,a=!0,s=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function tv(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0&&"pointerdown"===t.type&&!function(t,e){for(let n=0;ne.pointerId===t.pointerId)&&n.push(t),e.call(this,t)}}(eh().PointerEventInput),eh().MouseInput.prototype.handler=function(t){let e=ep[t.type];1&e&&t.button>=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))};const ef=eh().Manager;/* harmony default export */var ed=eh();// CONCATENATED MODULE: ./node_modules/mjolnir.js/dist/esm/constants.js //# sourceMappingURL=hammer.browser.js.map -const ev=ed?[[ed.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[ed.Rotate,{enable:!1}],[ed.Pinch,{enable:!1}],[ed.Swipe,{enable:!1}],[ed.Pan,{threshold:0,enable:!1}],[ed.Press,{enable:!1}],[ed.Tap,{event:"doubletap",taps:2,enable:!1}],[ed.Tap,{event:"anytap",enable:!1}],[ed.Tap,{enable:!1}]]:null,eg={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},em={doubletap:["tap"]},eb={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},ey={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},ew={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},eO={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},eE="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",e_="undefined"!=typeof window?window:n.g;void 0!==n.g?n.g:window;let eP=!1;try{const t={get passive(){return eP=!0,!0}};e_.addEventListener("test",t,t),e_.removeEventListener("test",t,t)}catch(t){}// CONCATENATED MODULE: ./node_modules/mjolnir.js/dist/esm/inputs/wheel-input.js +const ev=ed?[[ed.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[ed.Rotate,{enable:!1}],[ed.Pinch,{enable:!1}],[ed.Swipe,{enable:!1}],[ed.Pan,{threshold:0,enable:!1}],[ed.Press,{enable:!1}],[ed.Tap,{event:"doubletap",taps:2,enable:!1}],[ed.Tap,{event:"anytap",enable:!1}],[ed.Tap,{enable:!1}]]:null,eg={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},em={doubletap:["tap"]},eb={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},ey={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},ew={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},eO={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},eE="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",e_="undefined"!=typeof window?window:n.g;void 0!==n.g&&n.g;let eP=!1;try{const t={get passive(){return eP=!0,!0}};e_.addEventListener("test",t,t),e_.removeEventListener("test",t,t)}catch(t){}// CONCATENATED MODULE: ./node_modules/mjolnir.js/dist/esm/inputs/wheel-input.js //# sourceMappingURL=globals.js.map const eM=-1!==eE.indexOf("firefox"),{WHEEL_EVENTS:ej}=ey,eS="wheel";class eT{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.events=ej.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent,!!eP&&{passive:!1}))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){t===eS&&(this.options.enable=e)}handleEvent(t){if(!this.options.enable)return;let e=t.deltaY;e_.WheelEvent&&(eM&&t.deltaMode===e_.WheelEvent.DOM_DELTA_PIXEL&&(e/=e_.devicePixelRatio),t.deltaMode===e_.WheelEvent.DOM_DELTA_LINE&&(e*=40));const n={x:t.clientX,y:t.clientY};0!==e&&e%4.000244140625==0&&(e=Math.floor(e/4.000244140625)),t.shiftKey&&e&&(e*=.25),this._onWheel(t,-e,n)}_onWheel(t,e,n){this.callback({type:eS,center:n,delta:e,srcEvent:t,pointerType:"mouse",target:t.target})}}// CONCATENATED MODULE: ./node_modules/mjolnir.js/dist/esm/inputs/move-input.js //# sourceMappingURL=wheel-input.js.map diff --git a/crates/swc_ecma_minifier/tests/full/size/183435826ca7dac36bdd1f6e603ba738fc710a1b/output.js b/crates/swc_ecma_minifier/tests/full/size/183435826ca7dac36bdd1f6e603ba738fc710a1b/output.js index fcb4c1c8455f1..86ca8e0c2d6c1 100644 --- a/crates/swc_ecma_minifier/tests/full/size/183435826ca7dac36bdd1f6e603ba738fc710a1b/output.js +++ b/crates/swc_ecma_minifier/tests/full/size/183435826ca7dac36bdd1f6e603ba738fc710a1b/output.js @@ -1 +1 @@ -[](function(){a}); +[](function(){}); diff --git a/crates/swc_ecma_minifier/tests/full/size/24ba4747cd0b1c8200a359bc28b0040cc47a3f09/output.js b/crates/swc_ecma_minifier/tests/full/size/24ba4747cd0b1c8200a359bc28b0040cc47a3f09/output.js index 825e9cd4d426d..0c62ebc35b9ed 100644 --- a/crates/swc_ecma_minifier/tests/full/size/24ba4747cd0b1c8200a359bc28b0040cc47a3f09/output.js +++ b/crates/swc_ecma_minifier/tests/full/size/24ba4747cd0b1c8200a359bc28b0040cc47a3f09/output.js @@ -1 +1 @@ -[]({a(){window}}); +[]({a(){}}); diff --git a/crates/swc_ecma_minifier/tests/full/size/39ee86af2a2157bccd42915ff69b6d3abff2b725/output.js b/crates/swc_ecma_minifier/tests/full/size/39ee86af2a2157bccd42915ff69b6d3abff2b725/output.js index 5a0792ca82da0..b32f0e3bf9078 100644 --- a/crates/swc_ecma_minifier/tests/full/size/39ee86af2a2157bccd42915ff69b6d3abff2b725/output.js +++ b/crates/swc_ecma_minifier/tests/full/size/39ee86af2a2157bccd42915ff69b6d3abff2b725/output.js @@ -1 +1 @@ -c(function(){b}); +c(function(){}); diff --git a/crates/swc_ecma_minifier/tests/full/size/6d52ebcc72a64f1f1ef2594baecb5dcab49b1a32/output.js b/crates/swc_ecma_minifier/tests/full/size/6d52ebcc72a64f1f1ef2594baecb5dcab49b1a32/output.js index a5b53fe76fff9..1ce4a0230fc95 100644 --- a/crates/swc_ecma_minifier/tests/full/size/6d52ebcc72a64f1f1ef2594baecb5dcab49b1a32/output.js +++ b/crates/swc_ecma_minifier/tests/full/size/6d52ebcc72a64f1f1ef2594baecb5dcab49b1a32/output.js @@ -1 +1 @@ -[]({d(){if(a)try{for(c;;);}catch{}}}); +[]({d(){if(a)try{for(;;);}catch{}}}); diff --git a/crates/swc_ecma_minifier/tests/full/size/ecbeb82a70cef8575c7f48355f383c6c4cc1bca4/output.js b/crates/swc_ecma_minifier/tests/full/size/ecbeb82a70cef8575c7f48355f383c6c4cc1bca4/output.js index c9d98caafa18b..39b1afda58810 100644 --- a/crates/swc_ecma_minifier/tests/full/size/ecbeb82a70cef8575c7f48355f383c6c4cc1bca4/output.js +++ b/crates/swc_ecma_minifier/tests/full/size/ecbeb82a70cef8575c7f48355f383c6c4cc1bca4/output.js @@ -1 +1 @@ -[]({b(){a;"use strict"}}); +[]({b(){}}); diff --git a/crates/swc_ecma_minifier/tests/terser/compress/arrow/call_args_drop_param/output.js b/crates/swc_ecma_minifier/tests/terser/compress/arrow/call_args_drop_param/output.js index 70f136819d622..c429f59223287 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/arrow/call_args_drop_param/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/arrow/call_args_drop_param/output.js @@ -1,3 +1,2 @@ const a = 1; console.log(1); -b; diff --git a/crates/swc_ecma_minifier/tests/terser/compress/async/async_function_declaration/output.js b/crates/swc_ecma_minifier/tests/terser/compress/async/async_function_declaration/output.js index f5644091164d9..876565475433d 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/async/async_function_declaration/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/async/async_function_declaration/output.js @@ -1,6 +1,6 @@ async function f0() {} async function f1() { - await x, y; + await x; } async function f2() { await (x + y); @@ -9,7 +9,7 @@ async function f3() { await x, await y; } async function f4() { - await (x + (await y)); + await (x + await y); } async function f5() { await x; diff --git a/crates/swc_ecma_minifier/tests/terser/compress/collapse_vars/issue_2203_1/output.js b/crates/swc_ecma_minifier/tests/terser/compress/collapse_vars/issue_2203_1/output.js index d3b0187891d96..e36ec3fa50001 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/collapse_vars/issue_2203_1/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/collapse_vars/issue_2203_1/output.js @@ -1,11 +1,9 @@ a = "FAIL"; -console.log( - { - a: "PASS", - b: function () { - return (function (c) { - return c.a; - })((String, Object, this)); - }, - }.b() -); +console.log(({ + a: "PASS", + b: function() { + return function(c) { + return c.a; + }(this); + } +}).b()); diff --git a/crates/swc_ecma_minifier/tests/terser/compress/collapse_vars/issue_2203_3/output.js b/crates/swc_ecma_minifier/tests/terser/compress/collapse_vars/issue_2203_3/output.js index 72d16c0ea1ef0..720e5e76b002e 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/collapse_vars/issue_2203_3/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/collapse_vars/issue_2203_3/output.js @@ -1,11 +1,9 @@ a = "FAIL"; -console.log( - { - a: "PASS", - b: function () { - return (function (c) { - return c.a; - })((String, Object, (() => this)())); - }, - }.b() -); +console.log(({ + a: "PASS", + b: function() { + return function(c) { + return c.a; + }((()=>this)()); + } +}).b()); diff --git a/crates/swc_ecma_minifier/tests/terser/compress/conditionals/cond_7_1/output.js b/crates/swc_ecma_minifier/tests/terser/compress/conditionals/cond_7_1/output.js index de4e181f9d333..46ed1849a53b3 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/conditionals/cond_7_1/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/conditionals/cond_7_1/output.js @@ -1,2 +1,2 @@ var x; -y, x = 2; +x = 2; diff --git a/crates/swc_ecma_minifier/tests/terser/compress/dead_code/issue_2233_2/output.js b/crates/swc_ecma_minifier/tests/terser/compress/dead_code/issue_2233_2/output.js index b35b0292baa67..d0b643467a348 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/dead_code/issue_2233_2/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/dead_code/issue_2233_2/output.js @@ -1,6 +1,4 @@ var RegExp; -UndeclaredGlobal; function foo() { - AnotherUndeclaredGlobal; (void 0).isNaN; } diff --git a/crates/swc_ecma_minifier/tests/terser/compress/dead_code/issue_2233_3/output.js b/crates/swc_ecma_minifier/tests/terser/compress/dead_code/issue_2233_3/output.js index bfad9f5f20ce9..e69de29bb2d1d 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/dead_code/issue_2233_3/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/dead_code/issue_2233_3/output.js @@ -1 +0,0 @@ -UndeclaredGlobal; diff --git a/crates/swc_ecma_minifier/tests/terser/compress/drop_unused/global_var/output.js b/crates/swc_ecma_minifier/tests/terser/compress/drop_unused/global_var/output.js index 102c3274dc892..65ea586a0853a 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/drop_unused/global_var/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/drop_unused/global_var/output.js @@ -1,7 +1,5 @@ var a; function foo(b) { - c; - c; b && b.ar(); return b; } diff --git a/crates/swc_ecma_minifier/tests/terser/compress/drop_unused/iife/output.js b/crates/swc_ecma_minifier/tests/terser/compress/drop_unused/iife/output.js index d7638f2856cb3..0d090bd255872 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/drop_unused/iife/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/drop_unused/iife/output.js @@ -1,3 +1 @@ -function f() { - b; -} +function f() {} diff --git a/crates/swc_ecma_minifier/tests/terser/compress/drop_unused/issue_2226_1/output.js b/crates/swc_ecma_minifier/tests/terser/compress/drop_unused/issue_2226_1/output.js index 8525c18d00b95..864b77972ffa8 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/drop_unused/issue_2226_1/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/drop_unused/issue_2226_1/output.js @@ -1,10 +1,5 @@ -function f1() { - b; - c; -} -function f2(a) { - b; -} +function f1() {} +function f2(a) {} function f3(a) {} function f4() { var a = b; diff --git a/crates/swc_ecma_minifier/tests/terser/compress/evaluate/call_args_drop_param/output.js b/crates/swc_ecma_minifier/tests/terser/compress/evaluate/call_args_drop_param/output.js index 70f136819d622..c429f59223287 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/evaluate/call_args_drop_param/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/evaluate/call_args_drop_param/output.js @@ -1,3 +1,2 @@ const a = 1; console.log(1); -b; diff --git a/crates/swc_ecma_minifier/tests/terser/compress/export/export_default_anonymous_async_function_not_call/output.js b/crates/swc_ecma_minifier/tests/terser/compress/export/export_default_anonymous_async_function_not_call/output.js index 3e391fb2dc049..39157ee49063a 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/export/export_default_anonymous_async_function_not_call/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/export/export_default_anonymous_async_function_not_call/output.js @@ -1,2 +1 @@ -export default async function () { } -foo; +export default async function() {} diff --git a/crates/swc_ecma_minifier/tests/terser/compress/export/export_default_anonymous_generator_not_call/output.js b/crates/swc_ecma_minifier/tests/terser/compress/export/export_default_anonymous_generator_not_call/output.js index 5323ff1eef535..6910b64cd4b89 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/export/export_default_anonymous_generator_not_call/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/export/export_default_anonymous_generator_not_call/output.js @@ -1,2 +1 @@ -export default function* () { } -foo \ No newline at end of file +export default function*() {} diff --git a/crates/swc_ecma_minifier/tests/terser/compress/harmony/class_extends/output.js b/crates/swc_ecma_minifier/tests/terser/compress/harmony/class_extends/output.js index 0288a39d937c0..52946cb5fc841 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/harmony/class_extends/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/harmony/class_extends/output.js @@ -1,9 +1,16 @@ function f() { - class foo extends bar {} - class pro extends some.prop {} - class arr extends stuff[0] {} - class bin extends (a || b) {} - class seq extends (a, b) {} - class ter extends (a ? b : c) {} - class uni extends (!0) {} + class foo extends bar { + } + class pro extends some.prop { + } + class arr extends stuff[0] { + } + class bin extends (a || b) { + } + class seq extends b { + } + class ter extends (a ? b : c) { + } + class uni extends (!0) { + } } diff --git a/crates/swc_ecma_minifier/tests/terser/compress/issue_281/issue_1288_side_effects/output.js b/crates/swc_ecma_minifier/tests/terser/compress/issue_281/issue_1288_side_effects/output.js index 2213d95f852fe..891f57c55c633 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/issue_281/issue_1288_side_effects/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/issue_281/issue_1288_side_effects/output.js @@ -1,3 +1 @@ -w; x || (x = {}); -y; diff --git a/crates/swc_ecma_minifier/tests/terser/compress/issue_640/limit_1/output.js b/crates/swc_ecma_minifier/tests/terser/compress/issue_640/limit_1/output.js index ce562be494aa0..37e094fc87b37 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/issue_640/limit_1/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/issue_640/limit_1/output.js @@ -1 +1 @@ -a, b, c, d, e, f, g, h, i, j, k; +k; diff --git a/crates/swc_ecma_minifier/tests/terser/compress/negate_iife/issue_1288_side_effects/output.js b/crates/swc_ecma_minifier/tests/terser/compress/negate_iife/issue_1288_side_effects/output.js index 9aed934113c2f..7833b1c42efed 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/negate_iife/issue_1288_side_effects/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/negate_iife/issue_1288_side_effects/output.js @@ -1,6 +1,3 @@ -w; -x || - (function () { - x = {}; - })(); -y; +x || function() { + x = {}; +}(); diff --git a/crates/swc_ecma_minifier/tests/terser/compress/pure_funcs/array/output.js b/crates/swc_ecma_minifier/tests/terser/compress/pure_funcs/array/output.js index 09dbf51be69f1..39aab93a2fc57 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/pure_funcs/array/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/pure_funcs/array/output.js @@ -1,4 +1,2 @@ var a; -function f(b) { - c; -} +function f(b) {} diff --git a/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_call/output.js b/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_call/output.js index 7003e51213034..324acdfea4a53 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_call/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_call/output.js @@ -1,4 +1,5 @@ -global.a = { b: null }; +global.a = { + b: null +}; let foo = "PASS"; -a.b?.c((foo = "FAIL")); console.log(foo); diff --git a/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_call_direct/output.js b/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_call_direct/output.js index 30b9d963b11bf..324acdfea4a53 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_call_direct/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_call_direct/output.js @@ -1,4 +1,5 @@ -global.a = { b: null }; +global.a = { + b: null +}; let foo = "PASS"; -a.b?.((foo = "FAIL")); console.log(foo); diff --git a/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_certain_and_uncertain_part/output.js b/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_certain_and_uncertain_part/output.js index 27e1abcda0486..2e0b03e7e2ea1 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_certain_and_uncertain_part/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_certain_and_uncertain_part/output.js @@ -1,4 +1,5 @@ -global.a = { b: null }; +global.a = { + b: null +}; let foo = "FAIL"; -a.b?.[(foo = "PASS")]?.d((foo = "FAIL")); console.log(foo); diff --git a/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_prop/output.js b/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_prop/output.js index 2d578c4ef801a..ca78d8005d2dd 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_prop/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_prop/output.js @@ -1,4 +1,3 @@ global.a = null; let foo = "PASS"; -a?.b[(foo = "FAIL")]; console.log(foo); diff --git a/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_prop_direct/output.js b/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_prop_direct/output.js index a65aab521e393..324acdfea4a53 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_prop_direct/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/conditional_chain_prop_direct/output.js @@ -1,4 +1,5 @@ -global.a = { b: null }; +global.a = { + b: null +}; let foo = "PASS"; -a.b?.[(foo = "FAIL")]; console.log(foo); diff --git a/crates/swc_ecma_minifier/tests/terser/compress/sequences/limit_1/output.js b/crates/swc_ecma_minifier/tests/terser/compress/sequences/limit_1/output.js index ce562be494aa0..37e094fc87b37 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/sequences/limit_1/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/sequences/limit_1/output.js @@ -1 +1 @@ -a, b, c, d, e, f, g, h, i, j, k; +k; diff --git a/crates/swc_ecma_minifier/tests/terser/compress/sequences/limit_2/output.js b/crates/swc_ecma_minifier/tests/terser/compress/sequences/limit_2/output.js index ce562be494aa0..37e094fc87b37 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/sequences/limit_2/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/sequences/limit_2/output.js @@ -1 +1 @@ -a, b, c, d, e, f, g, h, i, j, k; +k; diff --git a/crates/swc_ecma_minifier/tests/terser/compress/switch/if_switch_typeof/output.js b/crates/swc_ecma_minifier/tests/terser/compress/switch/if_switch_typeof/output.js index 31142aabfe70e..e69de29bb2d1d 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/switch/if_switch_typeof/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/switch/if_switch_typeof/output.js @@ -1 +0,0 @@ -a; diff --git a/crates/swc_ecma_minifier/tests/terser/compress/switch/issue_441_1/output.js b/crates/swc_ecma_minifier/tests/terser/compress/switch/issue_441_1/output.js index d11e0e546b7c2..4e6dc2cece9b0 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/switch/issue_441_1/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/switch/issue_441_1/output.js @@ -1,2 +1,2 @@ -foo, bar, baz; +baz; qux(); diff --git a/crates/swc_ecma_minifier/tests/terser/compress/switch/issue_441_2/output.js b/crates/swc_ecma_minifier/tests/terser/compress/switch/issue_441_2/output.js index c12dd7b652ab6..4e6dc2cece9b0 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/switch/issue_441_2/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/switch/issue_441_2/output.js @@ -1,2 +1,2 @@ -foo, bar, fall, baz; +baz; qux(); diff --git a/crates/swc_ecma_minifier/tests/terser/compress/template_string/tagged_template_function_inline_1/output.js b/crates/swc_ecma_minifier/tests/terser/compress/template_string/tagged_template_function_inline_1/output.js index 94c52bbea22b7..e69de29bb2d1d 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/template_string/tagged_template_function_inline_1/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/template_string/tagged_template_function_inline_1/output.js @@ -1 +0,0 @@ -(() => {})`test`; diff --git a/crates/swc_ecma_minifier/tests/terser/compress/template_string/tagged_template_function_inline_5/output.js b/crates/swc_ecma_minifier/tests/terser/compress/template_string/tagged_template_function_inline_5/output.js index 11af6f42b0c4e..e69de29bb2d1d 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/template_string/tagged_template_function_inline_5/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/template_string/tagged_template_function_inline_5/output.js @@ -1 +0,0 @@ -({ pl() {} }.pl`test`); diff --git a/crates/swc_ecma_minifier/tests/terser/compress/template_string/tagged_template_parens/output.js b/crates/swc_ecma_minifier/tests/terser/compress/template_string/tagged_template_parens/output.js index a9c6b1e73297f..461970790b7dd 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/template_string/tagged_template_parens/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/template_string/tagged_template_parens/output.js @@ -3,7 +3,7 @@ a`0`; (a = b)`2`; (a + b)`3`; (a ? b : c)`4`; -(a, b, c)`5`; +c`5`; (~a)`6`; a.b`7`; a["b"]`8`; diff --git a/crates/swc_ecma_minifier/tests/terser/compress/transform/while_if_break/output.js b/crates/swc_ecma_minifier/tests/terser/compress/transform/while_if_break/output.js index def3d718a35e7..054f10ad3a1ac 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/transform/while_if_break/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/transform/while_if_break/output.js @@ -1 +1 @@ -for (; a && (b && c && d, !e); ); +for(; a && !e;);