fix(es/typescript): transform namespace with multiple identifiers in name (#2952)

swc_ecma_transforms_typescript:
 - Allow using typescript namespace with mutli-identifer name. (Closes #2810)
This commit is contained in:
David Sherret 2021-12-05 02:26:53 -05:00 committed by GitHub
parent ffec782a41
commit 0a8a5a1c78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
106 changed files with 1305 additions and 201 deletions

View File

@ -57,5 +57,23 @@ var m;
var m1;
(function(m1) {
var x;
let m21;
(function(m2) {
let m3;
(function(m3) {
var b = x; // new scope - number | boolean | string
var y;
if (typeof x === "string") {
y = x // string;
;
} else {
y = typeof x === "boolean" ? x.toString() // boolean
: x.toString(); // number
}
})(m3 || (m3 = {
}));
m2.m3 = m3;
})(m21 || (m21 = {
}));
})(m1 || (m1 = {
}));

View File

@ -1,8 +1,15 @@
var m;
var m, m1;
!function(m) {
var x;
let m2;
m2 || (m2 = {
}), "string" == typeof x || ("boolean" == typeof x, x.toString());
}(m || (m = {
})), (function(m1) {
var x, m2;
let m21, m3;
m2 = m21 || (m21 = {
}), m3 || (m3 = {
}), "string" == typeof x || ("boolean" == typeof x, x.toString()), m2.m3 = m3;
})(m1 || (m1 = {
}));

View File

@ -57,5 +57,23 @@ var m;
var m1;
(function(m1) {
var x;
var m21;
(function(m2) {
var m3;
(function(m3) {
var b = x; // new scope - number | boolean | string
var y;
if (typeof x === "string") {
y = x // string;
;
} else {
y = typeof x === "boolean" ? x.toString() // boolean
: x.toString(); // number
}
})(m3 || (m3 = {
}));
m2.m3 = m3;
})(m21 || (m21 = {
}));
})(m1 || (m1 = {
}));

View File

@ -1,7 +1,13 @@
var m;
var m, m1;
!function(m) {
var x, m2;
m2 || (m2 = {
}), "string" == typeof x || ("boolean" == typeof x, x.toString());
}(m || (m = {
})), (function(m1) {
var x, m2, m21, m3;
m21 = m2 || (m2 = {
}), m3 || (m3 = {
}), "string" == typeof x || ("boolean" == typeof x, x.toString()), m21.m3 = m3;
})(m1 || (m1 = {
}));

View File

@ -31,7 +31,7 @@ var m2;
var var2;
var var3;
let m31;
(function(m3) {
(function(m32) {
// global vars in function declaration
num = typeof var1 === "string" && var1.length; // string
// local variables from outer module declaration
@ -51,9 +51,35 @@ var m2;
} else {
strOrNum = var5; // string | number
}
m3.var5 = var5;
m32.var5 = var5;
})(m31 || (m31 = {
}));
m21.var3 = var3;
})(m2 || (m2 = {
}));
// Dotted module
var m3;
(function(m33) {
let m41;
(function(m4) {
// global vars in function declaration
num = typeof var1 === "string" && var1.length; // string
// variables in module declaration
var var2;
if (typeof var2 === "string") {
num = var2.length; // string
} else {
num = var2; // number
}
var var3;
if (typeof var3 === "string") {
strOrNum = var3; // string | number
} else {
strOrNum = var3; // string | number
}
m4.var3 = var3;
})(m41 || (m41 = {
}));
m33.m4 = m41;
})(m3 || (m3 = {
}));

View File

@ -1,12 +1,18 @@
var num, strOrNum, var1, m1, m2;
var num, strOrNum, var1, m1, m2, m3;
!function(m11) {
var var2, var3;
num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 ? var2.length : var2, "string" == typeof var3, strOrNum = var3, m11.var3 = var3;
}(m1 || (m1 = {
})), (function(m21) {
var var2, var3, m3, var4, var5;
var var2, var3, m32, var4, var5;
let m31;
m3 = m31 || (m31 = {
}), num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 && var2.length, strOrNum = "string" == typeof var3 && var3, num = "string" == typeof var4 ? var4.length : var4, "string" == typeof var5, strOrNum = var5, m3.var5 = var5, m21.var3 = var3;
m32 = m31 || (m31 = {
}), num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 && var2.length, strOrNum = "string" == typeof var3 && var3, num = "string" == typeof var4 ? var4.length : var4, "string" == typeof var5, strOrNum = var5, m32.var5 = var5, m21.var3 = var3;
})(m2 || (m2 = {
})), (function(m33) {
var m4, var2, var3;
let m41;
m4 = m41 || (m41 = {
}), num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 ? var2.length : var2, "string" == typeof var3, strOrNum = var3, m4.var3 = var3, m33.m4 = m41;
})(m3 || (m3 = {
}));

View File

@ -31,7 +31,7 @@ var m2;
var var2;
var var3;
var m31;
(function(m3) {
(function(m32) {
// global vars in function declaration
num = typeof var1 === "string" && var1.length; // string
// local variables from outer module declaration
@ -51,9 +51,35 @@ var m2;
} else {
strOrNum = var5; // string | number
}
m3.var5 = var5;
m32.var5 = var5;
})(m31 || (m31 = {
}));
m21.var3 = var3;
})(m2 || (m2 = {
}));
// Dotted module
var m3;
(function(m33) {
var m41;
(function(m4) {
// global vars in function declaration
num = typeof var1 === "string" && var1.length; // string
// variables in module declaration
var var2;
if (typeof var2 === "string") {
num = var2.length; // string
} else {
num = var2; // number
}
var var3;
if (typeof var3 === "string") {
strOrNum = var3; // string | number
} else {
strOrNum = var3; // string | number
}
m4.var3 = var3;
})(m41 || (m41 = {
}));
m33.m4 = m41;
})(m3 || (m3 = {
}));

View File

@ -1,11 +1,16 @@
var num, strOrNum, var1, m1, m2;
var num, strOrNum, var1, m1, m2, m3;
!function(m11) {
var var2, var3;
num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 ? var2.length : var2, "string" == typeof var3, strOrNum = var3, m11.var3 = var3;
}(m1 || (m1 = {
})), (function(m21) {
var var2, var3, m3, m31, var4, var5;
m31 = m3 || (m3 = {
var var2, var3, m32, m31, var4, var5;
m31 = m32 || (m32 = {
}), num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 && var2.length, strOrNum = "string" == typeof var3 && var3, num = "string" == typeof var4 ? var4.length : var4, "string" == typeof var5, strOrNum = var5, m31.var5 = var5, m21.var3 = var3;
})(m2 || (m2 = {
})), (function(m33) {
var m4, m41, var2, var3;
m41 = m4 || (m4 = {
}), num = "string" == typeof var1 && var1.length, num = "string" == typeof var2 ? var2.length : var2, "string" == typeof var3, strOrNum = var3, m41.var3 = var3, m33.m4 = m4;
})(m3 || (m3 = {
}));

View File

@ -1,3 +1,34 @@
// @filename: class.ts
var X;
(function(X1) {
let Y1;
(function(Y) {
class Point {
constructor(x, y){
this.x = x;
this.y = y;
}
}
Y.Point = Point;
})(Y1 || (Y1 = {
}));
X1.Y = Y1;
})(X || (X = {
}));
(function(X2) {
let Y2;
(function(Y) {
let Point1;
(function(Point) {
Point.Origin = new Point1(0, 0);
})(Point1 || (Point1 = {
}));
Y.Point = Point1;
})(Y2 || (Y2 = {
}));
X2.Y = Y2;
})(X || (X = {
}));
// @filename: test.ts
//var cl: { x: number; y: number; }
var cl = new X.Y.Point(1, 1);

View File

@ -1,4 +1,21 @@
new X.Y.Point(1, 1), X.Y.Point.Origin;
var X;
!function(X1) {
let Y;
(Y || (Y = {
})).Point = class {
constructor(x, y){
this.x = x, this.y = y;
}
}, X1.Y = Y;
}(X || (X = {
})), (function(X2) {
var Y;
let Y1, Point;
Y = Y1 || (Y1 = {
}), (Point || (Point = {
})).Origin = new Point(0, 0), Y.Point = Point, X2.Y = Y1;
})(X || (X = {
})), new X.Y.Point(1, 1), X.Y.Point.Origin;
class A {
}
(A || (A = {

View File

@ -3,6 +3,37 @@ function _classCallCheck(instance, Constructor) {
throw new TypeError("Cannot call a class as a function");
}
}
// @filename: class.ts
var X;
(function(X1) {
var Y1;
(function(Y) {
var Point = function Point(x, y) {
"use strict";
_classCallCheck(this, Point);
this.x = x;
this.y = y;
};
Y.Point = Point;
})(Y1 || (Y1 = {
}));
X1.Y = Y1;
})(X || (X = {
}));
(function(X2) {
var Y2;
(function(Y) {
var Point1;
(function(Point) {
Point.Origin = new Point1(0, 0);
})(Point1 || (Point1 = {
}));
Y.Point = Point1;
})(Y2 || (Y2 = {
}));
X2.Y = Y2;
})(X || (X = {
}));
// @filename: test.ts
//var cl: { x: number; y: number; }
var cl = new X.Y.Point(1, 1);

View File

@ -1,9 +1,24 @@
new X.Y.Point(1, 1), X.Y.Point.Origin;
var A = function() {
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
!function(X1) {
var Y, Y1, Point;
Y1 = Y || (Y = {
}), Point = function(x, y) {
"use strict";
_classCallCheck(this, Point), this.x = x, this.y = y;
}, Y1.Point = Point, X1.Y = Y;
}(X || (X = {
})), (function(X2) {
var Y, Y2, Point;
Y2 = Y || (Y = {
}), (Point || (Point = {
})).Origin = new Point(0, 0), Y2.Point = Point, X2.Y = Y;
})(X || (X = {
})), new X.Y.Point(1, 1), X.Y.Point.Origin;
var X, A = function() {
"use strict";
!function(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}(this, A);
_classCallCheck(this, A);
};
(A || (A = {
})).Instance = new A(), A.Instance, new A();

View File

@ -1,3 +1,35 @@
// @target: ES6
// @filename: class.ts
var X;
(function(X1) {
let Y1;
(function(Y) {
class Point {
constructor(x, y){
this.x = x;
this.y = y;
}
}
Y.Point = Point;
})(Y1 || (Y1 = {
}));
X1.Y = Y1;
})(X || (X = {
}));
(function(X2) {
let Y2;
(function(Y) {
let Point1;
(function(Point) {
Point.Origin = new Point1(0, 0);
})(Point1 || (Point1 = {
}));
Y.Point = Point1;
})(Y2 || (Y2 = {
}));
X2.Y = Y2;
})(X || (X = {
}));
// @filename: test.ts
//var cl: { x: number; y: number; }
var cl = new X.Y.Point(1, 1);

View File

@ -1,4 +1,21 @@
new X.Y.Point(1, 1), X.Y.Point.Origin;
var X;
!function(X1) {
let Y;
(Y || (Y = {
})).Point = class {
constructor(x, y){
this.x = x, this.y = y;
}
}, X1.Y = Y;
}(X || (X = {
})), (function(X2) {
var Y;
let Y1, Point;
Y = Y1 || (Y1 = {
}), (Point || (Point = {
})).Origin = new Point(0, 0), Y.Point = Point, X2.Y = Y1;
})(X || (X = {
})), new X.Y.Point(1, 1), X.Y.Point.Origin;
class A {
}
(A || (A = {

View File

@ -3,6 +3,38 @@ function _classCallCheck(instance, Constructor) {
throw new TypeError("Cannot call a class as a function");
}
}
// @target: ES6
// @filename: class.ts
var X;
(function(X1) {
var Y1;
(function(Y) {
var Point = function Point(x, y) {
"use strict";
_classCallCheck(this, Point);
this.x = x;
this.y = y;
};
Y.Point = Point;
})(Y1 || (Y1 = {
}));
X1.Y = Y1;
})(X || (X = {
}));
(function(X2) {
var Y2;
(function(Y) {
var Point1;
(function(Point) {
Point.Origin = new Point1(0, 0);
})(Point1 || (Point1 = {
}));
Y.Point = Point1;
})(Y2 || (Y2 = {
}));
X2.Y = Y2;
})(X || (X = {
}));
// @filename: test.ts
//var cl: { x: number; y: number; }
var cl = new X.Y.Point(1, 1);

View File

@ -1,9 +1,24 @@
new X.Y.Point(1, 1), X.Y.Point.Origin;
var A = function() {
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
!function(X1) {
var Y, Y1, Point;
Y1 = Y || (Y = {
}), Point = function(x, y) {
"use strict";
_classCallCheck(this, Point), this.x = x, this.y = y;
}, Y1.Point = Point, X1.Y = Y;
}(X || (X = {
})), (function(X2) {
var Y, Y2, Point;
Y2 = Y || (Y = {
}), (Point || (Point = {
})).Origin = new Point(0, 0), Y2.Point = Point, X2.Y = Y;
})(X || (X = {
})), new X.Y.Point(1, 1), X.Y.Point.Origin;
var X, A = function() {
"use strict";
!function(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}(this, A);
_classCallCheck(this, A);
};
(A || (A = {
})).Instance = new A(), A.Instance, new A();

View File

@ -1,3 +1,34 @@
// @Filename: module.ts
var X;
(function(X1) {
let Y1;
(function(Y) {
let Point1;
(function(Point) {
Point.Origin = new Point1(0, 0);
})(Point1 || (Point1 = {
}));
Y.Point = Point1;
})(Y1 || (Y1 = {
}));
X1.Y = Y1;
})(X || (X = {
}));
(function(X2) {
let Y2;
(function(Y) {
class Point {
constructor(x, y){
this.x = x;
this.y = y;
}
}
Y.Point = Point;
})(Y2 || (Y2 = {
}));
X2.Y = Y2;
})(X || (X = {
}));
(function(A1) {
A1.Instance = new A();
})(A || (A = {

View File

@ -1,4 +1,21 @@
(A || (A = {
var X;
!function(X1) {
var Y;
let Y1, Point;
Y = Y1 || (Y1 = {
}), (Point || (Point = {
})).Origin = new Point(0, 0), Y.Point = Point, X1.Y = Y1;
}(X || (X = {
})), (function(X2) {
let Y;
(Y || (Y = {
})).Point = class {
constructor(x, y){
this.x = x, this.y = y;
}
}, X2.Y = Y;
})(X || (X = {
})), (A || (A = {
})).Instance = new A();
class A {
}

View File

@ -3,6 +3,37 @@ function _classCallCheck(instance, Constructor) {
throw new TypeError("Cannot call a class as a function");
}
}
// @Filename: module.ts
var X;
(function(X1) {
var Y1;
(function(Y) {
var Point1;
(function(Point) {
Point.Origin = new Point1(0, 0);
})(Point1 || (Point1 = {
}));
Y.Point = Point1;
})(Y1 || (Y1 = {
}));
X1.Y = Y1;
})(X || (X = {
}));
(function(X2) {
var Y2;
(function(Y) {
var Point = function Point(x, y) {
"use strict";
_classCallCheck(this, Point);
this.x = x;
this.y = y;
};
Y.Point = Point;
})(Y2 || (Y2 = {
}));
X2.Y = Y2;
})(X || (X = {
}));
(function(A1) {
A1.Instance = new A();
})(A || (A = {

View File

@ -1,8 +1,23 @@
(A || (A = {
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
!function(X1) {
var Y, Y1, Point;
Y1 = Y || (Y = {
}), (Point || (Point = {
})).Origin = new Point(0, 0), Y1.Point = Point, X1.Y = Y;
}(X || (X = {
})), (function(X2) {
var Y, Y2, Point;
Y2 = Y || (Y = {
}), Point = function(x, y) {
"use strict";
_classCallCheck(this, Point), this.x = x, this.y = y;
}, Y2.Point = Point, X2.Y = Y;
})(X || (X = {
})), (A || (A = {
})).Instance = new A();
var A = function A() {
var X, A = function A() {
"use strict";
!function(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}(this, A);
_classCallCheck(this, A);
};

View File

@ -22,6 +22,22 @@ var p;
var X;
(function(X1) {
let Y1;
(function(Y) {
let Z1;
(function(Z) {
class Line {
}
Z.Line = Line;
})(Z1 || (Z1 = {
}));
Y.Z = Z1;
})(Y1 || (Y1 = {
}));
X1.Y = Y1;
})(X || (X = {
}));
(function(X2) {
let Y2;
(function(Y) {
let Z;
(function(Z) {
@ -30,9 +46,9 @@ var X;
})(Z || (Z = {
}));
Y.Z = Z;
})(Y1 || (Y1 = {
})(Y2 || (Y2 = {
}));
X1.Y = Y1;
X2.Y = Y2;
})(X || (X = {
}));
// ensure merges as expected

View File

@ -2,8 +2,16 @@ var A, X;
(A || (A = {
})).Point = class {
}, (function(X1) {
var Y;
let Y1, Z;
Y = Y1 || (Y1 = {
}), (Z || (Z = {
})).Line = class {
}, Y.Z = Z, X1.Y = Y1;
})(X || (X = {
})), (function(X2) {
let Y, Z;
(Y || (Y = {
})).Z = Z, X1.Y = Y;
})).Z = Z, X2.Y = Y;
})(X || (X = {
}));

View File

@ -53,6 +53,24 @@ var p;
var X;
(function(X1) {
var Y1;
(function(Y) {
var Z1;
(function(Z) {
var Line = function Line() {
"use strict";
_classCallCheck(this, Line);
};
Z.Line = Line;
})(Z1 || (Z1 = {
}));
Y.Z = Z1;
})(Y1 || (Y1 = {
}));
X1.Y = Y1;
})(X || (X = {
}));
(function(X2) {
var Y2;
(function(Y) {
var Z;
(function(Z) {
@ -63,9 +81,9 @@ var X;
})(Z || (Z = {
}));
Y.Z = Z;
})(Y1 || (Y1 = {
})(Y2 || (Y2 = {
}));
X1.Y = Y1;
X2.Y = Y2;
})(X || (X = {
}));
// ensure merges as expected

View File

@ -36,12 +36,21 @@ function _defineProperties(target, props) {
}();
})(A || (A = {
})), (function(X1) {
var Y, Y1, Z, Line;
var Y, Y1, Z, Z1, Line;
Y1 = Y || (Y = {
}), Z1 = Z || (Z = {
}), Line = function() {
"use strict";
_classCallCheck(this, Line);
}, Z1.Line = Line, Y1.Z = Z, X1.Y = Y;
})(X || (X = {
})), (function(X2) {
var Y, Y2, Z, Line;
Y2 = Y || (Y = {
}), Z || (Z = {
}), Line = function() {
"use strict";
_classCallCheck(this, Line);
}, Y1.Z = Z, X1.Y = Y;
}, Y2.Z = Z, X2.Y = Y;
})(X || (X = {
}));

View File

@ -28,3 +28,19 @@ var X;
X1.Y = Y1;
})(X || (X = {
}));
(function(X2) {
let Y2;
(function(Y) {
let Z2;
(function(Z) {
class Line {
}
Z.Line = Line;
})(Z2 || (Z2 = {
}));
Y.Z = Z2;
})(Y2 || (Y2 = {
}));
X2.Y = Y2;
})(X || (X = {
}));

View File

@ -11,4 +11,12 @@ var A, X;
})).Line = class {
}, Y.Z = Z, X1.Y = Y1;
})(X || (X = {
})), (function(X2) {
var Y;
let Y2, Z;
Y = Y2 || (Y2 = {
}), (Z || (Z = {
})).Line = class {
}, Y.Z = Z, X2.Y = Y2;
})(X || (X = {
}));

View File

@ -39,3 +39,21 @@ var X;
X1.Y = Y1;
})(X || (X = {
}));
(function(X2) {
var Y2;
(function(Y) {
var Z2;
(function(Z) {
var Line = function Line() {
"use strict";
_classCallCheck(this, Line);
};
Z.Line = Line;
})(Z2 || (Z2 = {
}));
Y.Z = Z2;
})(Y2 || (Y2 = {
}));
X2.Y = Y2;
})(X || (X = {
}));

View File

@ -25,4 +25,13 @@ function _classCallCheck(instance, Constructor) {
_classCallCheck(this, Line);
}, Z1.Line = Line, Y1.Z = Z, X1.Y = Y;
})(X || (X = {
})), (function(X2) {
var Y, Y2, Z, Z2, Line;
Y2 = Y || (Y = {
}), Z2 = Z || (Z = {
}), Line = function() {
"use strict";
_classCallCheck(this, Line);
}, Z2.Line = Line, Y2.Z = Z, X2.Y = Y;
})(X || (X = {
}));

View File

@ -1,11 +1,21 @@
var A;
(function(A) {
(function(A1) {
let B1;
(function(B) {
var x1;
B.x = x1;
})(B1 || (B1 = {
}));
A1.B = B1;
})(A || (A = {
}));
(function(A) {
let B2;
(function(B) {
var x2;
B.x = x2;
})(B2 || (B2 = {
}));
})(A || (A = {
}));
// ensure the right var decl is exported
@ -13,7 +23,7 @@ var x;
var x = A.B.x;
var X;
(function(X1) {
let Y;
let Y1;
(function(Y) {
let Z1;
(function(Z) {
@ -22,9 +32,25 @@ var X;
Z.Line = Line;
})(Z1 || (Z1 = {
}));
Y.Z = Z1;
})(Y1 || (Y1 = {
}));
X1.Y = Y1;
})(X || (X = {
}));
(function(X2) {
let Y;
(function(Y) {
let Z2;
(function(Z) {
class Line {
}
Z.Line = Line;
})(Z2 || (Z2 = {
}));
})(Y || (Y = {
}));
X1.Y = Y;
X2.Y = Y;
})(X || (X = {
}));
// make sure merging works as expected

View File

@ -1,15 +1,29 @@
var A, X;
!function(A) {
!function(A1) {
var x;
let B;
(B || (B = {
})).x = x, A1.B = B;
}(A || (A = {
})), (function(A) {
var x;
let B;
(B || (B = {
})).x = x;
}(A || (A = {
})(A || (A = {
})), A.B.x, (function(X1) {
var Y;
let Y1, Z;
Y = Y1 || (Y1 = {
}), (Z || (Z = {
})).Line = class {
}, Y.Z = Z, X1.Y = Y1;
})(X || (X = {
})), (function(X2) {
let Y, Z;
Y || (Y = {
}), (Z || (Z = {
})).Line = class {
}, X1.Y = Y;
}, X2.Y = Y;
})(X || (X = {
}));

View File

@ -4,13 +4,23 @@ function _classCallCheck(instance, Constructor) {
}
}
var A;
(function(A) {
(function(A1) {
var B1;
(function(B) {
var x1;
B.x = x1;
})(B1 || (B1 = {
}));
A1.B = B1;
})(A || (A = {
}));
(function(A) {
var B2;
(function(B) {
var x2;
B.x = x2;
})(B2 || (B2 = {
}));
})(A || (A = {
}));
// ensure the right var decl is exported
@ -18,7 +28,7 @@ var x;
var x = A.B.x;
var X;
(function(X1) {
var Y;
var Y1;
(function(Y) {
var Z1;
(function(Z) {
@ -29,9 +39,27 @@ var X;
Z.Line = Line;
})(Z1 || (Z1 = {
}));
Y.Z = Z1;
})(Y1 || (Y1 = {
}));
X1.Y = Y1;
})(X || (X = {
}));
(function(X2) {
var Y;
(function(Y) {
var Z2;
(function(Z) {
var Line = function Line() {
"use strict";
_classCallCheck(this, Line);
};
Z.Line = Line;
})(Z2 || (Z2 = {
}));
})(Y || (Y = {
}));
X1.Y = Y;
X2.Y = Y;
})(X || (X = {
}));
// make sure merging works as expected

View File

@ -1,18 +1,33 @@
var A, X;
!function(A) {
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
!function(A1) {
var B, x;
(B || (B = {
})).x = x, A1.B = B;
}(A || (A = {
})), (function(A) {
var B, x;
(B || (B = {
})).x = x;
}(A || (A = {
})(A || (A = {
})), A.B.x, (function(X1) {
var Y, Z, Z1, Line;
Y || (Y = {
var Y, Y1, Z, Z1, Line;
Y1 = Y || (Y = {
}), Z1 = Z || (Z = {
}), Line = function() {
"use strict";
!function(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}(this, Line);
}, Z1.Line = Line, X1.Y = Y;
_classCallCheck(this, Line);
}, Z1.Line = Line, Y1.Z = Z, X1.Y = Y;
})(X || (X = {
})), (function(X2) {
var Y, Z, Z2, Line;
Y || (Y = {
}), Z2 = Z || (Z = {
}), Line = function() {
"use strict";
_classCallCheck(this, Line);
}, Z2.Line = Line, X2.Y = Y;
})(X || (X = {
}));

View File

@ -22,7 +22,7 @@ var X;
(function(X2) {
var X1 = 13;
let Y2;
(function(Y) {
(function(Y3) {
var Y1 = 13;
let Z;
(function(Z) {
@ -31,12 +31,28 @@ var X;
var Z1 = 12;
})(Z || (Z = {
}));
Y.Z = Z;
Y3.Z = Z;
})(Y2 || (Y2 = {
}));
X2.Y = Y2;
})(X || (X = {
}));
var Y;
(function(Y5) {
let Y4;
(function(Y6) {
let Y4;
(function(Y4) {
Y4[Y4["Red"] = 0] = "Red";
Y4[Y4["Blue"] = 1] = "Blue";
})(Y4 || (Y4 = {
}));
Y6.Y = Y4;
})(Y4 || (Y4 = {
}));
Y5.Y = Y4;
})(Y || (Y = {
}));
// no collision, since interface doesn't
// generate code.
var D;

View File

@ -1,8 +1,15 @@
var X, D;
var X, Y, D;
!function(X1) {
let Y, Z;
(Y || (Y = {
})).Z = Z, X1.Y = Y;
let Y1, Z;
(Y1 || (Y1 = {
})).Z = Z, X1.Y = Y1;
}(X || (X = {
})), (function(Y4) {
var Y2, Y3;
let Y3, Y3;
Y2 = Y3 || (Y3 = {
}), (Y3 = Y3 || (Y3 = {
}))[Y3.Red = 0] = "Red", Y3[Y3.Blue = 1] = "Blue", Y2.Y = Y3, Y4.Y = Y3;
})(Y || (Y = {
})), (D || (D = {
})).E = "hello";

View File

@ -27,7 +27,7 @@ var X;
(function(X2) {
var X1 = 13;
var Y2;
(function(Y) {
(function(Y3) {
var Y1 = 13;
var Z;
(function(Z) {
@ -36,12 +36,28 @@ var X;
var Z1 = 12;
})(Z || (Z = {
}));
Y.Z = Z;
Y3.Z = Z;
})(Y2 || (Y2 = {
}));
X2.Y = Y2;
})(X || (X = {
}));
var Y;
(function(Y5) {
var Y4;
(function(Y6) {
var Y4;
(function(Y4) {
Y4[Y4["Red"] = 0] = "Red";
Y4[Y4["Blue"] = 1] = "Blue";
})(Y4 || (Y4 = {
}));
Y6.Y = Y4;
})(Y4 || (Y4 = {
}));
Y5.Y = Y4;
})(Y || (Y = {
}));
// no collision, since interface doesn't
// generate code.
var D;

View File

@ -1,4 +1,4 @@
var B, X, D;
var B, X, Y, D;
!function(B) {
var B1 = function() {
"use strict";
@ -8,9 +8,15 @@ var B, X, D;
};
}(B || (B = {
})), (function(X1) {
var Y, Z;
(Y || (Y = {
})).Z = Z, X1.Y = Y;
var Y1, Z;
(Y1 || (Y1 = {
})).Z = Z, X1.Y = Y1;
})(X || (X = {
})), (function(Y4) {
var Y2, Y3, Y2, Y2;
Y3 = Y2 || (Y2 = {
}), (Y2 = Y2 || (Y2 = {
}))[Y2.Red = 0] = "Red", Y2[Y2.Blue = 1] = "Blue", Y3.Y = Y2, Y4.Y = Y2;
})(Y || (Y = {
})), (D || (D = {
})).E = "hello";

View File

@ -1 +1,11 @@
let namespace = 10;
var a;
(function(a1) {
let b1;
(function(b) {
b.c = 20;
})(b1 || (b1 = {
}));
a1.b = b1;
})(a || (a = {
}));

View File

@ -0,0 +1,7 @@
var a;
!function(a1) {
let b;
(b || (b = {
})).c = 20, a1.b = b;
}(a || (a = {
}));

View File

@ -1 +1,11 @@
var namespace = 10;
var a;
(function(a1) {
var b1;
(function(b) {
b.c = 20;
})(b1 || (b1 = {
}));
a1.b = b1;
})(a || (a = {
}));

View File

@ -0,0 +1,7 @@
var a;
!function(a1) {
var b;
(b || (b = {
})).c = 20, a1.b = b;
}(a || (a = {
}));

View File

@ -2,22 +2,49 @@ var A;
(function(A1) {
let B1;
(function(B) {
class C {
}
B.C = C;
let C1;
(function(C) {
class Point {
}
C.Point = Point;
})(C1 || (C1 = {
}));
B.C = C1;
})(B1 || (B1 = {
}));
A1.B = B1;
})(A || (A = {
}));
(function(A2) {
let B2;
(function(B) {
class C {
}
B.C = C;
})(B2 || (B2 = {
}));
A2.B = B2;
})(A || (A = {
}));
var M2;
(function(M21) {
let X1;
(function(X) {
var Point;
class Point {
}
X.Point = Point;
})(X1 || (X1 = {
}));
M21.X = X1;
})(M2 || (M2 = {
}));
(function(M22) {
let X2;
(function(X) {
var Point;
X.Point = Point;
})(X2 || (X2 = {
}));
M22.X = X2;
})(M2 || (M2 = {
}));

View File

@ -1,14 +1,28 @@
var A, M2;
!function(A1) {
var B;
let B1, C;
B = B1 || (B1 = {
}), (C || (C = {
})).Point = class {
}, B.C = C, A1.B = B1;
}(A || (A = {
})), (function(A2) {
let B;
(B || (B = {
})).C = class {
}, A1.B = B;
}(A || (A = {
}, A2.B = B;
})(A || (A = {
})), (function(M21) {
let X;
(X || (X = {
})).Point = class {
}, M21.X = X;
})(M2 || (M2 = {
})), (function(M22) {
var Point;
let X;
(X || (X = {
})).Point = Point, M21.X = X;
})).Point = Point, M22.X = X;
})(M2 || (M2 = {
}));

View File

@ -6,25 +6,56 @@ function _classCallCheck(instance, Constructor) {
var A;
(function(A1) {
var B1;
(function(B) {
var C1;
(function(C) {
var Point = function Point() {
"use strict";
_classCallCheck(this, Point);
};
C.Point = Point;
})(C1 || (C1 = {
}));
B.C = C1;
})(B1 || (B1 = {
}));
A1.B = B1;
})(A || (A = {
}));
(function(A2) {
var B2;
(function(B) {
var C = function C() {
"use strict";
_classCallCheck(this, C);
};
B.C = C;
})(B1 || (B1 = {
})(B2 || (B2 = {
}));
A1.B = B1;
A2.B = B2;
})(A || (A = {
}));
var M2;
(function(M21) {
var X1;
(function(X) {
var Point;
var Point = function Point() {
"use strict";
_classCallCheck(this, Point);
};
X.Point = Point;
})(X1 || (X1 = {
}));
M21.X = X1;
})(M2 || (M2 = {
}));
(function(M22) {
var X2;
(function(X) {
var Point;
X.Point = Point;
})(X2 || (X2 = {
}));
M22.X = X2;
})(M2 || (M2 = {
}));

View File

@ -1,17 +1,35 @@
var A, M2;
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
!function(A1) {
var B, B1, C;
var B, B1, C, C1, Point;
B1 = B || (B = {
}), C1 = C || (C = {
}), Point = function() {
"use strict";
_classCallCheck(this, Point);
}, C1.Point = Point, B1.C = C, A1.B = B;
}(A || (A = {
})), (function(A2) {
var B, B2, C;
B2 = B || (B = {
}), C = function() {
"use strict";
!function(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}(this, C);
}, B1.C = C, A1.B = B;
}(A || (A = {
_classCallCheck(this, C);
}, B2.C = C, A2.B = B;
})(A || (A = {
})), (function(M21) {
var X, X1, Point;
X1 = X || (X = {
}), Point = function() {
"use strict";
_classCallCheck(this, Point);
}, X1.Point = Point, M21.X = X;
})(M2 || (M2 = {
})), (function(M22) {
var X, Point;
(X || (X = {
})).Point = Point, M21.X = X;
})).Point = Point, M22.X = X;
})(M2 || (M2 = {
}));

View File

@ -1,5 +1,4 @@
var A;
(function(A1) {
(function(A) {
let B;
(function(B) {
var Point = {
@ -8,18 +7,17 @@ var A;
}; // bug 832088: could not find module 'C'
})(B || (B = {
}));
A1.B = B;
A.B = B;
})(A || (A = {
}));
var M2;
(function(M21) {
(function(M2) {
let X1;
(function(X) {
var Point;
X.Point = Point;
})(X1 || (X1 = {
}));
M21.X = X1;
M2.X = X1;
})(M2 || (M2 = {
}));
var m = M2.X;

View File

@ -1,12 +1,11 @@
var A, M2;
!function(A1) {
!function(A) {
let B;
A1.B = B;
A.B = B;
}(A || (A = {
})), (function(M21) {
})), (function(M2) {
var Point;
let X;
(X || (X = {
})).Point = Point, M21.X = X;
})).Point = Point, M2.X = X;
})(M2 || (M2 = {
})), M2.X.Point;

View File

@ -1,5 +1,4 @@
var A;
(function(A1) {
(function(A) {
var B;
(function(B) {
var Point = {
@ -8,18 +7,17 @@ var A;
}; // bug 832088: could not find module 'C'
})(B || (B = {
}));
A1.B = B;
A.B = B;
})(A || (A = {
}));
var M2;
(function(M21) {
(function(M2) {
var X1;
(function(X) {
var Point;
X.Point = Point;
})(X1 || (X1 = {
}));
M21.X = X1;
M2.X = X1;
})(M2 || (M2 = {
}));
var m = M2.X;

View File

@ -1,11 +1,10 @@
var A, M2;
!function(A1) {
!function(A) {
var B;
A1.B = B;
A.B = B;
}(A || (A = {
})), (function(M21) {
})), (function(M2) {
var X, Point;
(X || (X = {
})).Point = Point, M21.X = X;
})).Point = Point, M2.X = X;
})(M2 || (M2 = {
})), M2.X.Point;

View File

@ -3,3 +3,17 @@ class C {
super.foo();
}
}
var M1;
(function(M11) {
let M2;
(function(M2) {
class C {
foo() {
super.foo();
}
}
})(M2 || (M2 = {
}));
M11.M2 = M2;
})(M1 || (M1 = {
}));

View File

@ -0,0 +1,6 @@
var M1;
!function(M11) {
let M2;
M11.M2 = M2;
}(M1 || (M1 = {
}));

View File

@ -61,3 +61,27 @@ var C = /*#__PURE__*/ function() {
]);
return C;
}();
var M1;
(function(M11) {
var M2;
(function(M2) {
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
_classCallCheck(this, C);
}
_createClass(C, [
{
key: "foo",
value: function foo() {
_get(_getPrototypeOf(C.prototype), "foo", this).call(this);
}
}
]);
return C;
}();
})(M2 || (M2 = {
}));
M11.M2 = M2;
})(M1 || (M1 = {
}));

View File

@ -1,9 +1,15 @@
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(target, props) {
for(var i = 0; i < props.length; i++){
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
}
function _get(target, property, receiver) {
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get : function _get(target, property, receiver) {
var base = _superPropBase(target, property);
@ -22,20 +28,36 @@ function _superPropBase(object, property) {
for(; !Object.prototype.hasOwnProperty.call(object, property) && null !== (object = _getPrototypeOf(object)););
return object;
}
var C = function() {
var M1, C = function() {
"use strict";
var Constructor, protoProps, staticProps;
function C() {
!function(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}(this, C);
_classCallCheck(this, C);
}
return Constructor = C, protoProps = [
return _createClass(C, [
{
key: "foo",
value: function() {
_get(_getPrototypeOf(C.prototype), "foo", this).call(this);
}
}
], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C;
]), C;
}();
!function(M11) {
var M2, C;
M2 || (M2 = {
}), C = (function() {
"use strict";
function C() {
_classCallCheck(this, C);
}
return _createClass(C, [
{
key: "foo",
value: function() {
_get(_getPrototypeOf(C.prototype), "foo", this).call(this);
}
}
]), C;
})(), M11.M2 = M2;
}(M1 || (M1 = {
}));

View File

@ -3,3 +3,17 @@ class C {
super.foo = 1;
}
}
var M1;
(function(M11) {
let M2;
(function(M2) {
class C {
foo() {
super.foo = 1;
}
}
})(M2 || (M2 = {
}));
M11.M2 = M2;
})(M1 || (M1 = {
}));

View File

@ -0,0 +1,6 @@
var M1;
!function(M11) {
let M2;
M11.M2 = M2;
}(M1 || (M1 = {
}));

View File

@ -96,3 +96,27 @@ var C = /*#__PURE__*/ function() {
]);
return C;
}();
var M1;
(function(M11) {
var M2;
(function(M2) {
var C = /*#__PURE__*/ function() {
"use strict";
function C() {
_classCallCheck(this, C);
}
_createClass(C, [
{
key: "foo",
value: function foo() {
_set(_getPrototypeOf(C.prototype), "foo", 1, this, true);
}
}
]);
return C;
}();
})(M2 || (M2 = {
}));
M11.M2 = M2;
})(M1 || (M1 = {
}));

View File

@ -1,9 +1,15 @@
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(target, props) {
for(var i = 0; i < props.length; i++){
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
}
function _getPrototypeOf(o) {
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
@ -28,27 +34,44 @@ function set(target, property, value, receiver) {
return !0;
}, set(target, property, value, receiver);
}
function _set(target, property, value, receiver, isStrict) {
if (!set(target, property, value, receiver || target) && isStrict) throw new Error("failed to set property");
return value;
}
function _superPropBase(object, property) {
for(; !Object.prototype.hasOwnProperty.call(object, property) && null !== (object = _getPrototypeOf(object)););
return object;
}
var C = function() {
var M1, C = function() {
"use strict";
var Constructor, protoProps, staticProps;
function C() {
!function(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}(this, C);
_classCallCheck(this, C);
}
return Constructor = C, protoProps = [
return _createClass(C, [
{
key: "foo",
value: function() {
!function(target, property, value, receiver, isStrict) {
if (!set(target, property, value, receiver || target) && isStrict) throw new Error("failed to set property");
return value;
}(_getPrototypeOf(C.prototype), "foo", 1, this, !0);
_set(_getPrototypeOf(C.prototype), "foo", 1, this, !0);
}
}
], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), C;
]), C;
}();
!function(M11) {
var M2, C;
M2 || (M2 = {
}), C = (function() {
"use strict";
function C() {
_classCallCheck(this, C);
}
return _createClass(C, [
{
key: "foo",
value: function() {
_set(_getPrototypeOf(C.prototype), "foo", 1, this, !0);
}
}
]), C;
})(), M11.M2 = M2;
}(M1 || (M1 = {
}));

View File

@ -0,0 +1,37 @@
// Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0.
// See LICENSE.txt in the project root for complete license information.
///<reference path='typescript.ts' />
var TypeScript;
(function(TypeScript1) {
let AstWalkerWithDetailCallback1;
(function(AstWalkerWithDetailCallback) {
function walk(script, callback) {
var pre = (cur, parent)=>{
walker.options.goChildren = AstWalkerCallback(true, cur, callback);
return cur;
};
var post = (cur, parent)=>{
AstWalkerCallback(false, cur, callback);
return cur;
};
var walker = TypeScript.getAstWalkerFactory().getWalker(pre, post);
walker.walk(script, null);
}
AstWalkerWithDetailCallback.walk = walk;
function AstWalkerCallback(pre, ast, callback) {
// See if the Callback needs to be handled using specific one or default one
var nodeType = ast.nodeType;
var callbackString = NodeType._map[nodeType] + "Callback";
if (callback[callbackString]) {
return callback[callbackString](pre, ast);
}
if (callback.DefaultCallback) {
return callback.DefaultCallback(pre, ast);
}
return true;
}
})(AstWalkerWithDetailCallback1 || (AstWalkerWithDetailCallback1 = {
}));
TypeScript1.AstWalkerWithDetailCallback = AstWalkerWithDetailCallback1;
})(TypeScript || (TypeScript = {
}));

View File

@ -0,0 +1,18 @@
var TypeScript;
!function(TypeScript1) {
let AstWalkerWithDetailCallback1;
!function(AstWalkerWithDetailCallback) {
function AstWalkerCallback(pre, ast, callback) {
var nodeType = ast.nodeType, callbackString = NodeType._map[nodeType] + "Callback";
return callback[callbackString] ? callback[callbackString](pre, ast) : !callback.DefaultCallback || callback.DefaultCallback(pre, ast);
}
AstWalkerWithDetailCallback.walk = function(script, callback) {
var pre = (cur, parent)=>(walker.options.goChildren = AstWalkerCallback(!0, cur, callback), cur)
, post = (cur, parent)=>(AstWalkerCallback(!1, cur, callback), cur)
, walker = TypeScript.getAstWalkerFactory().getWalker(pre, post);
walker.walk(script, null);
};
}(AstWalkerWithDetailCallback1 || (AstWalkerWithDetailCallback1 = {
})), TypeScript1.AstWalkerWithDetailCallback = AstWalkerWithDetailCallback1;
}(TypeScript || (TypeScript = {
}));

View File

@ -0,0 +1,37 @@
// Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0.
// See LICENSE.txt in the project root for complete license information.
///<reference path='typescript.ts' />
var TypeScript;
(function(TypeScript1) {
var AstWalkerWithDetailCallback1;
(function(AstWalkerWithDetailCallback) {
function walk(script, callback) {
var pre = function(cur, parent) {
walker.options.goChildren = AstWalkerCallback(true, cur, callback);
return cur;
};
var post = function(cur, parent) {
AstWalkerCallback(false, cur, callback);
return cur;
};
var walker = TypeScript.getAstWalkerFactory().getWalker(pre, post);
walker.walk(script, null);
}
AstWalkerWithDetailCallback.walk = walk;
function AstWalkerCallback(pre, ast, callback) {
// See if the Callback needs to be handled using specific one or default one
var nodeType = ast.nodeType;
var callbackString = NodeType._map[nodeType] + "Callback";
if (callback[callbackString]) {
return callback[callbackString](pre, ast);
}
if (callback.DefaultCallback) {
return callback.DefaultCallback(pre, ast);
}
return true;
}
})(AstWalkerWithDetailCallback1 || (AstWalkerWithDetailCallback1 = {
}));
TypeScript1.AstWalkerWithDetailCallback = AstWalkerWithDetailCallback1;
})(TypeScript || (TypeScript = {
}));

View File

@ -0,0 +1,20 @@
var TypeScript;
!function(TypeScript1) {
var AstWalkerWithDetailCallback1;
!function(AstWalkerWithDetailCallback) {
function AstWalkerCallback(pre, ast, callback) {
var nodeType = ast.nodeType, callbackString = NodeType._map[nodeType] + "Callback";
return callback[callbackString] ? callback[callbackString](pre, ast) : !callback.DefaultCallback || callback.DefaultCallback(pre, ast);
}
AstWalkerWithDetailCallback.walk = function(script, callback) {
var pre = function(cur, parent) {
return walker.options.goChildren = AstWalkerCallback(!0, cur, callback), cur;
}, post = function(cur, parent) {
return AstWalkerCallback(!1, cur, callback), cur;
}, walker = TypeScript.getAstWalkerFactory().getWalker(pre, post);
walker.walk(script, null);
};
}(AstWalkerWithDetailCallback1 || (AstWalkerWithDetailCallback1 = {
})), TypeScript1.AstWalkerWithDetailCallback = AstWalkerWithDetailCallback1;
}(TypeScript || (TypeScript = {
}));

Some files were not shown because too many files have changed in this diff Show More