Skip to content

Commit

Permalink
Revert "feat(es/minifier): Detect TypeScript enum initialization patt…
Browse files Browse the repository at this point in the history
…ern (swc-project#8986)"

This reverts commit cc8c155.
  • Loading branch information
kdy1 committed Jun 11, 2024
1 parent abcf21d commit 02dc116
Show file tree
Hide file tree
Showing 384 changed files with 1,049 additions and 885 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
//// [module.d.ts]
//// [classPoint.ts]
var A;
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
(A || (A = {})).Point = function Point(x, y) {
_class_call_check(this, Point), this.x = x, this.y = y;
};
//// [test.ts]
A.Point.Origin, new A.Point(0, 0);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//// [ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts]
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
var A, Point, Point1 = function() {
var A, Point, A1, Point1 = function() {
function Point(x, y) {
_class_call_check(this, Point), this.x = x, this.y = y;
}
Expand All @@ -13,7 +13,7 @@ var A, Point, Point1 = function() {
}();
(Point1 || (Point1 = {})).Origin = function() {
return null;
}, A = {}, Point = function() {
}, A = A1 || (A1 = {}), Point = function() {
function Point(x, y) {
_class_call_check(this, Point), this.x = x, this.y = y;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//// [ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts]
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
var A, Point, Point1 = function() {
var A, Point, A1, Point1 = function() {
function Point(x, y) {
_class_call_check(this, Point), this.x = x, this.y = y;
}
Expand All @@ -11,7 +11,7 @@ var A, Point, Point1 = function() {
};
}, Point;
}();
Point1 || (Point1 = {}), A = {}, Point = function() {
Point1 || (Point1 = {}), A = A1 || (A1 = {}), Point = function() {
function Point(x, y) {
_class_call_check(this, Point), this.x = x, this.y = y;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//// [ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts]
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
var A, Point, Point1 = function Point(x, y) {
var A, Point, A1, Point1 = function Point(x, y) {
_class_call_check(this, Point), this.x = x, this.y = y;
};
Point1.Origin = {
x: 0,
y: 0
}, (Point1 || (Point1 = {})).Origin = "", A = {}, (Point = function Point(x, y) {
}, (Point1 || (Point1 = {})).Origin = "", A = A1 || (A1 = {}), (Point = function Point(x, y) {
_class_call_check(this, Point), this.x = x, this.y = y;
}).Origin = {
x: 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//// [ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts]
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
var A, Point, Point1 = function Point(x, y) {
var A, Point, A1, Point1 = function Point(x, y) {
_class_call_check(this, Point), this.x = x, this.y = y;
};
Point1.Origin = {
x: 0,
y: 0
}, Point1 || (Point1 = {}), A = {}, (Point = function Point(x, y) {
}, Point1 || (Point1 = {}), A = A1 || (A1 = {}), (Point = function Point(x, y) {
_class_call_check(this, Point), this.x = x, this.y = y;
}).Origin = {
x: 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//// [class.ts]
var X;
var X, X1;
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
((X = {}).Y || (X.Y = {})).Point = function Point(x, y) {
((X1 = X || (X = {})).Y || (X1.Y = {})).Point = function Point(x, y) {
_class_call_check(this, Point), this.x = x, this.y = y;
};
//// [module.ts]
var X, Y, Point;
(Point = (Y = (X = {}).Y || (X.Y = {})).Point || (Y.Point = {})).Origin = new Point(0, 0);
var X, X1, Y, Point;
(Point = (Y = (X1 = X || (X = {})).Y || (X1.Y = {})).Point || (Y.Point = {})).Origin = new Point(0, 0);
//// [test.ts]
new X.Y.Point(1, 1), X.Y.Point.Origin;
//// [simple.ts]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//// [class.ts]
var X;
((X = {}).Y || (X.Y = {})).Point = class {
var X, X1;
((X1 = X || (X = {})).Y || (X1.Y = {})).Point = class {
constructor(x, y){
this.x = x, this.y = y;
}
};
//// [module.ts]
var X, Y, Point;
(Point = (Y = (X = {}).Y || (X.Y = {})).Point || (Y.Point = {})).Origin = new Point(0, 0);
var X, X1, Y, Point;
(Point = (Y = (X1 = X || (X = {})).Y || (X1.Y = {})).Point || (Y.Point = {})).Origin = new Point(0, 0);
//// [test.ts]
new X.Y.Point(1, 1), X.Y.Point.Origin;
//// [simple.ts]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//// [ES5SymbolProperty2.ts]
var M, M1, _$Symbol, C;
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
M1 = M = {}, C = function() {
M1 = M || (M = {}), C = function() {
function C() {
_class_call_check(this, C);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//// [ExportClassWhichExtendsInterfaceWithInaccessibleType.ts]
var A, Point2d;
var A, A1, Point2d;
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
A = {}, Point2d = function() {
A1 = A || (A = {}), Point2d = function() {
function Point2d(x, y) {
_class_call_check(this, Point2d), this.x = x, this.y = y;
}
return Point2d.prototype.fromOrigin = function(p) {
return 1;
}, Point2d;
}(), A.Point2d = Point2d;
}(), A1.Point2d = Point2d;
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//// [ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts]
var A, Point, Point3d;
var A, A1, Point, Point3d;
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";
A = {}, Point = function Point() {
A1 = A || (A = {}), Point = function Point() {
_class_call_check(this, Point);
}, A.Point = Point, A.Origin = {
}, A1.Point = Point, A1.Origin = {
x: 0,
y: 0
}, Point3d = function(Point) {
Expand All @@ -15,10 +15,10 @@ A = {}, Point = function Point() {
return _class_call_check(this, Point3d), _super.apply(this, arguments);
}
return Point3d;
}(Point), A.Point3d = Point3d, A.Origin3d = {
}(Point), A1.Point3d = Point3d, A1.Origin3d = {
x: 0,
y: 0,
z: 0
}, A.Line = function Line(start, end) {
}, A1.Line = function Line(start, end) {
_class_call_check(this, Line), this.start = start, this.end = end;
};
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
//// [ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts]
var A;
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
(A || (A = {})).points = function points() {
_class_call_check(this, points);
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//// [ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts]
var A, Point3d, Line;
var A, A1, Point3d, Line;
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";
(A = {}).Origin = {
(A1 = A || (A = {})).Origin = {
x: 0,
y: 0
}, Point3d = function(Point) {
Expand All @@ -15,7 +15,7 @@ import { _ as _create_super } from "@swc/helpers/_/_create_super";
return Point3d;
}(function Point() {
_class_call_check(this, Point);
}), A.Point3d = Point3d, A.Origin3d = {
}), A1.Point3d = Point3d, A1.Origin3d = {
x: 0,
y: 0,
z: 0
Expand All @@ -26,4 +26,4 @@ import { _ as _create_super } from "@swc/helpers/_/_create_super";
return Line.fromorigin2d = function(p) {
return null;
}, Line;
}(), A.Line = Line;
}(), A1.Line = Line;
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//// [ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts]
var A, Line;
var A, A1, Line;
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
(A = {}).Point = function Point() {
(A1 = A || (A = {})).Point = function Point() {
_class_call_check(this, Point);
}, Line = function Line(start, end) {
_class_call_check(this, Line), this.start = start, this.end = end;
}, A.Line = Line, A.fromOrigin = function(p) {
}, A1.Line = Line, A1.fromOrigin = function(p) {
return new Line({
x: 0,
y: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//// [ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts]
var A, Line;
var A, A1, Line;
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
A = {}, Line = function Line(start, end) {
A1 = A || (A = {}), Line = function Line(start, end) {
_class_call_check(this, Line), this.start = start, this.end = end;
}, A.Line = Line, A.fromOrigin = function(p) {
}, A1.Line = Line, A1.fromOrigin = function(p) {
return new Line({
x: 0,
y: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//// [ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts]
var A, Line;
var A, A1, Line;
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
(A = {}).Point = function Point() {
(A1 = A || (A = {})).Point = function Point() {
_class_call_check(this, Point);
}, Line = function Line(start, end) {
_class_call_check(this, Line), this.start = start, this.end = end;
}, A.fromOrigin = function(p) {
}, A1.fromOrigin = function(p) {
return new Line({
x: 0,
y: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//// [ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts]
var A;
(A = {}).Origin = {
var A, A1;
(A1 = A || (A = {})).Origin = {
x: 0,
y: 0
}, A.Origin3d = {
}, A1.Origin3d = {
x: 0,
y: 0,
z: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//// [ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts]
var A;
(A = {}).Origin = {
var A, A1;
(A1 = A || (A = {})).Origin = {
x: 0,
y: 0
}, A.Origin3d = {
}, A1.Origin3d = {
x: 0,
y: 0,
z: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//// [ExportModuleWithAccessibleTypesOnItsExportedMembers.ts]
var A, Point, B, Line;
var A, A1, Point, B, Line;
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
A = {}, Point = function Point(x, y) {
A1 = A || (A = {}), Point = function Point(x, y) {
_class_call_check(this, Point), this.x = x, this.y = y;
}, A.Point = Point, (B = A.B || (A.B = {})).Origin = new Point(0, 0), Line = function() {
}, A1.Point = Point, (B = A1.B || (A1.B = {})).Origin = new Point(0, 0), Line = function() {
function Line(start, end) {
_class_call_check(this, Line);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//// [ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts]
var A, Point;
var A, A1, Point;
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
A = {}, Point = function Point(x, y) {
A1 = A || (A = {}), Point = function Point(x, y) {
_class_call_check(this, Point), this.x = x, this.y = y;
}, A.Origin = {
}, A1.Origin = {
x: 0,
y: 0
}, A.Unity = {
}, A1.Unity = {
start: new Point(0, 0),
end: new Point(1, 0)
};
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
//// [ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts]
var A;
import "@swc/helpers/_/_class_call_check";
(A || (A = {})).UnitSquare = null;
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
//// [ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts]
var A;
import "@swc/helpers/_/_class_call_check";
(A || (A = {})).beez2 = [];
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
//// [ExportVariableWithAccessibleTypeInTypeAnnotation.ts]
var A;
(A || (A = {})).Origin = {
x: 0,
y: 0
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//// [ExportVariableWithInaccessibleTypeInTypeAnnotation.ts]
var A;
(A = {}).Origin = {
var A, A1;
(A1 = A || (A = {})).Origin = {
x: 0,
y: 0
}, A.Origin3d = {
}, A1.Origin3d = {
x: 0,
y: 0,
z: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
//// [function.ts]
//// [module.ts]
var A;
((A = {}).Point || (A.Point = {})).Origin = {
(A || (A = {})).Point = function() {
return {
x: 0,
y: 0
};
};
//// [module.ts]
var A, A1;
((A1 = A || (A = {})).Point || (A1.Point = {})).Origin = {
x: 0,
y: 0
};
Expand All @@ -20,4 +27,4 @@ var B;
x: 0,
y: 0
};
}(B = {}), B.Point, B.Point(), B.Point.Origin;
}(B || (B = {})), B.Point, B.Point(), B.Point.Origin;
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
//// [function.ts]
var A;
(A || (A = {})).Point = function() {
return {
x: 0,
y: 0
};
};
//// [module.ts]
var B;
((B = {}).Point || (B.Point = {})).Origin = {
var B, B1;
((B1 = B || (B = {})).Point || (B1.Point = {})).Origin = {
x: 0,
y: 0
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//// [module.ts]
var X, Y, Point;
(Point = (Y = (X = {}).Y || (X.Y = {})).Point || (Y.Point = {})).Origin = new Point(0, 0);
var X, X1, Y, Point;
(Point = (Y = (X1 = X || (X = {})).Y || (X1.Y = {})).Point || (Y.Point = {})).Origin = new Point(0, 0);
//// [classPoint.ts]
var X;
var X, X1;
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
((X = {}).Y || (X.Y = {})).Point = function Point(x, y) {
((X1 = X || (X = {})).Y || (X1.Y = {})).Point = function Point(x, y) {
_class_call_check(this, Point), this.x = x, this.y = y;
};
//// [simple.ts]
Expand Down
Loading

0 comments on commit 02dc116

Please sign in to comment.