mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 22:22:34 +03:00
fix(es/resolver): Hoist namespaces (#4902)
This commit is contained in:
parent
f54bc12e26
commit
a9f91dc797
14
crates/swc/tests/fixture/issues-4xxx/4897/input/.swcrc
Normal file
14
crates/swc/tests/fixture/issues-4xxx/4897/input/.swcrc
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"jsc": {
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"tsx": false
|
||||
},
|
||||
"target": "es2021",
|
||||
"loose": false
|
||||
},
|
||||
"module": {
|
||||
"type": "amd",
|
||||
"noInterop": true
|
||||
}
|
||||
}
|
7
crates/swc/tests/fixture/issues-4xxx/4897/input/index.ts
Normal file
7
crates/swc/tests/fixture/issues-4xxx/4897/input/index.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export function boo() {
|
||||
return Foo.Bar * 2;
|
||||
}
|
||||
|
||||
export namespace Foo {
|
||||
export const Bar = 1234;
|
||||
}
|
19
crates/swc/tests/fixture/issues-4xxx/4897/output/index.ts
Normal file
19
crates/swc/tests/fixture/issues-4xxx/4897/output/index.ts
Normal file
@ -0,0 +1,19 @@
|
||||
define([
|
||||
"require",
|
||||
"exports"
|
||||
], function(require, _exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(_exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
_exports.boo = boo;
|
||||
_exports.Foo = void 0;
|
||||
function boo() {
|
||||
return Foo1.Bar * 2;
|
||||
}
|
||||
var Foo1;
|
||||
_exports.Foo = Foo1;
|
||||
(function(Foo) {
|
||||
var Bar = Foo.Bar = 1234;
|
||||
})(Foo1 || (_exports.Foo = Foo1 = {}));
|
||||
});
|
@ -7,13 +7,13 @@ var B;
|
||||
}
|
||||
B1.D = D;
|
||||
})(B || (B = {}));
|
||||
var A1;
|
||||
(function(A) {
|
||||
var A;
|
||||
(function(A1) {
|
||||
class C {
|
||||
}
|
||||
A.C = C;
|
||||
A1.C = C;
|
||||
var b = B;
|
||||
A.b = b;
|
||||
})(A1 || (A1 = {}));
|
||||
A1.b = b;
|
||||
})(A || (A = {}));
|
||||
var c;
|
||||
var c = new B.a.C();
|
||||
|
@ -1,13 +1,13 @@
|
||||
var B, A1;
|
||||
var B, A;
|
||||
!function(B1) {
|
||||
var a = A;
|
||||
B1.a = a;
|
||||
class D extends a.C {
|
||||
}
|
||||
B1.D = D;
|
||||
}(B || (B = {})), function(A) {
|
||||
A.C = class {
|
||||
}(B || (B = {})), function(A1) {
|
||||
A1.C = class {
|
||||
};
|
||||
var b = B;
|
||||
A.b = b;
|
||||
}(A1 || (A1 = {})), new B.a.C();
|
||||
A1.b = b;
|
||||
}(A || (A = {})), new B.a.C();
|
||||
|
@ -18,15 +18,15 @@ var B;
|
||||
}(a.C);
|
||||
B1.D = D;
|
||||
})(B || (B = {}));
|
||||
var A1;
|
||||
(function(A) {
|
||||
var A;
|
||||
(function(A1) {
|
||||
var C = function C() {
|
||||
"use strict";
|
||||
_class_call_check(this, C);
|
||||
};
|
||||
A.C = C;
|
||||
A1.C = C;
|
||||
var b = B;
|
||||
A.b = b;
|
||||
})(A1 || (A1 = {}));
|
||||
A1.b = b;
|
||||
})(A || (A = {}));
|
||||
var c;
|
||||
var c = new B.a.C();
|
||||
|
@ -1,4 +1,4 @@
|
||||
var B, A1;
|
||||
var B, A;
|
||||
import _class_call_check from "@swc/helpers/lib/_class_call_check.js";
|
||||
import _inherits from "@swc/helpers/lib/_inherits.js";
|
||||
import _create_super from "@swc/helpers/lib/_create_super.js";
|
||||
@ -15,12 +15,12 @@ import _create_super from "@swc/helpers/lib/_create_super.js";
|
||||
return D;
|
||||
}(a.C);
|
||||
B1.D = D;
|
||||
}(B || (B = {})), function(A) {
|
||||
}(B || (B = {})), function(A1) {
|
||||
var C = function() {
|
||||
"use strict";
|
||||
_class_call_check(this, C);
|
||||
};
|
||||
A.C = C;
|
||||
A1.C = C;
|
||||
var b = B;
|
||||
A.b = b;
|
||||
}(A1 || (A1 = {})), new B.a.C();
|
||||
A1.b = b;
|
||||
}(A || (A = {})), new B.a.C();
|
||||
|
@ -6,15 +6,15 @@ var M;
|
||||
}
|
||||
M1.D = D;
|
||||
})(M || (M = {}));
|
||||
var N1;
|
||||
(function(N) {
|
||||
var N;
|
||||
(function(N1) {
|
||||
class E extends M.D {
|
||||
}
|
||||
N.E = E;
|
||||
})(N1 || (N1 = {}));
|
||||
N1.E = E;
|
||||
})(N || (N = {}));
|
||||
var O;
|
||||
(function(O) {
|
||||
class C2 extends Q.E2 {
|
||||
class C2 extends Q1.E2 {
|
||||
} // error
|
||||
let P1;
|
||||
(function(P) {
|
||||
|
@ -1,13 +1,13 @@
|
||||
var M, N1, O;
|
||||
var M, N, O;
|
||||
class C extends N.E {
|
||||
}
|
||||
(M || (M = {})).D = class extends C {
|
||||
}, function(N) {
|
||||
}, function(N1) {
|
||||
class E extends M.D {
|
||||
}
|
||||
N.E = E;
|
||||
}(N1 || (N1 = {})), function(O) {
|
||||
class C2 extends Q.E2 {
|
||||
N1.E = E;
|
||||
}(N || (N = {})), function(O) {
|
||||
class C2 extends Q1.E2 {
|
||||
}
|
||||
let P;
|
||||
(P || (P = {})).D2 = class extends C2 {
|
||||
|
@ -26,8 +26,8 @@ var M;
|
||||
}(C);
|
||||
M1.D = D;
|
||||
})(M || (M = {}));
|
||||
var _$N;
|
||||
(function(N) {
|
||||
var N;
|
||||
(function(N1) {
|
||||
var E = /*#__PURE__*/ function(_D) {
|
||||
"use strict";
|
||||
_inherits(E, _D);
|
||||
@ -38,8 +38,8 @@ var _$N;
|
||||
}
|
||||
return E;
|
||||
}(M.D);
|
||||
N.E = E;
|
||||
})(_$N || (_$N = {}));
|
||||
N1.E = E;
|
||||
})(N || (N = {}));
|
||||
var O;
|
||||
(function(O) {
|
||||
var C2 = /*#__PURE__*/ function(_E2) {
|
||||
@ -52,7 +52,7 @@ var O;
|
||||
}
|
||||
return C2;
|
||||
} // error
|
||||
(Q.E2);
|
||||
(Q1.E2);
|
||||
var P1;
|
||||
(function(P) {
|
||||
var D2 = /*#__PURE__*/ function(C2) {
|
||||
@ -67,7 +67,7 @@ var O;
|
||||
}(C2);
|
||||
P.D2 = D2;
|
||||
})(P1 || (P1 = {}));
|
||||
var _$Q;
|
||||
var Q1;
|
||||
(function(Q) {
|
||||
var E2 = /*#__PURE__*/ function(_D2) {
|
||||
"use strict";
|
||||
@ -80,5 +80,5 @@ var O;
|
||||
return E2;
|
||||
}(P1.D2);
|
||||
Q.E2 = E2;
|
||||
})(_$Q || (_$Q = {}));
|
||||
})(Q1 || (Q1 = {}));
|
||||
})(O || (O = {}));
|
||||
|
@ -1,7 +1,7 @@
|
||||
import _class_call_check from "@swc/helpers/lib/_class_call_check.js";
|
||||
import _inherits from "@swc/helpers/lib/_inherits.js";
|
||||
import _create_super from "@swc/helpers/lib/_create_super.js";
|
||||
var M, _$N, O, C = function(_E) {
|
||||
var M, N, O, C = function(_E) {
|
||||
"use strict";
|
||||
_inherits(C, _E);
|
||||
var _super = _create_super(C);
|
||||
@ -21,7 +21,7 @@ var M, _$N, O, C = function(_E) {
|
||||
return D;
|
||||
}(C);
|
||||
M1.D = D;
|
||||
}(M || (M = {})), function(N) {
|
||||
}(M || (M = {})), function(N1) {
|
||||
var E = function(_D) {
|
||||
"use strict";
|
||||
_inherits(E, _D);
|
||||
@ -31,9 +31,9 @@ var M, _$N, O, C = function(_E) {
|
||||
}
|
||||
return E;
|
||||
}(M.D);
|
||||
N.E = E;
|
||||
}(_$N || (_$N = {})), function(O) {
|
||||
var P, _$Q, P1, D2, Q1, E2, C2 = function(_E2) {
|
||||
N1.E = E;
|
||||
}(N || (N = {})), function(O) {
|
||||
var P, Q, P1, D2, Q1, E2, C2 = function(_E2) {
|
||||
"use strict";
|
||||
_inherits(C2, _E2);
|
||||
var _super = _create_super(C2);
|
||||
@ -50,7 +50,7 @@ var M, _$N, O, C = function(_E) {
|
||||
return _class_call_check(this, D2), _super.apply(this, arguments);
|
||||
}
|
||||
return D2;
|
||||
}(C2), P1.D2 = D2, Q1 = _$Q || (_$Q = {}), E2 = function(_D2) {
|
||||
}(C2), P1.D2 = D2, Q1 = Q || (Q = {}), E2 = function(_D2) {
|
||||
"use strict";
|
||||
_inherits(E2, _D2);
|
||||
var _super = _create_super(E2);
|
||||
|
@ -64,113 +64,113 @@ var TypeScript;
|
||||
return new AstWalker(this.childrenWalkers, pre, post, options, state);
|
||||
}
|
||||
initChildrenWalkers() {
|
||||
this.childrenWalkers[NodeType.None] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Empty] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.EmptyExpr] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.True] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.False] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.This] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Super] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.QString] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Regex] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Null] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.ArrayLit] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.ObjectLit] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Void] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Comma] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Pos] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Neg] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Delete] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Await] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.In] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Dot] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.From] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Is] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.InstOf] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Typeof] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.NumberLit] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Name] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.TypeRef] = ChildrenWalkers.walkTypeReferenceChildren;
|
||||
this.childrenWalkers[NodeType.Index] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Call] = ChildrenWalkers.walkCallExpressionChildren;
|
||||
this.childrenWalkers[NodeType.New] = ChildrenWalkers.walkCallExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Asg] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgAdd] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgSub] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgDiv] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgMul] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgMod] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgAnd] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgXor] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgOr] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgLsh] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgRsh] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgRs2] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.ConditionalExpression] = ChildrenWalkers.walkTrinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.LogOr] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.LogAnd] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Or] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Xor] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.And] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Eq] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Ne] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Eqv] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.NEqv] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Lt] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Le] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Gt] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Ge] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Add] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Sub] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Mul] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Div] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Mod] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Lsh] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Rsh] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Rs2] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Not] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.LogNot] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.IncPre] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.DecPre] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.IncPost] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.DecPost] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.TypeAssertion] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.FuncDecl] = ChildrenWalkers.walkFuncDeclChildren;
|
||||
this.childrenWalkers[NodeType.Member] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.VarDecl] = ChildrenWalkers.walkBoundDeclChildren;
|
||||
this.childrenWalkers[NodeType.ArgDecl] = ChildrenWalkers.walkBoundDeclChildren;
|
||||
this.childrenWalkers[NodeType.Return] = ChildrenWalkers.walkReturnStatementChildren;
|
||||
this.childrenWalkers[NodeType.Break] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Continue] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Throw] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.For] = ChildrenWalkers.walkForStatementChildren;
|
||||
this.childrenWalkers[NodeType.ForIn] = ChildrenWalkers.walkForInStatementChildren;
|
||||
this.childrenWalkers[NodeType.If] = ChildrenWalkers.walkIfStatementChildren;
|
||||
this.childrenWalkers[NodeType.While] = ChildrenWalkers.walkWhileStatementChildren;
|
||||
this.childrenWalkers[NodeType.DoWhile] = ChildrenWalkers.walkDoWhileStatementChildren;
|
||||
this.childrenWalkers[NodeType.Block] = ChildrenWalkers.walkBlockChildren;
|
||||
this.childrenWalkers[NodeType.Case] = ChildrenWalkers.walkCaseStatementChildren;
|
||||
this.childrenWalkers[NodeType.Switch] = ChildrenWalkers.walkSwitchStatementChildren;
|
||||
this.childrenWalkers[NodeType.Try] = ChildrenWalkers.walkTryChildren;
|
||||
this.childrenWalkers[NodeType.TryCatch] = ChildrenWalkers.walkTryCatchChildren;
|
||||
this.childrenWalkers[NodeType.TryFinally] = ChildrenWalkers.walkTryFinallyChildren;
|
||||
this.childrenWalkers[NodeType.Finally] = ChildrenWalkers.walkFinallyChildren;
|
||||
this.childrenWalkers[NodeType.Catch] = ChildrenWalkers.walkCatchChildren;
|
||||
this.childrenWalkers[NodeType.List] = ChildrenWalkers.walkListChildren;
|
||||
this.childrenWalkers[NodeType.Script] = ChildrenWalkers.walkScriptChildren;
|
||||
this.childrenWalkers[NodeType.ClassDeclaration] = ChildrenWalkers.walkClassDeclChildren;
|
||||
this.childrenWalkers[NodeType.InterfaceDeclaration] = ChildrenWalkers.walkTypeDeclChildren;
|
||||
this.childrenWalkers[NodeType.ModuleDeclaration] = ChildrenWalkers.walkModuleDeclChildren;
|
||||
this.childrenWalkers[NodeType.ImportDeclaration] = ChildrenWalkers.walkImportDeclChildren;
|
||||
this.childrenWalkers[NodeType.With] = ChildrenWalkers.walkWithStatementChildren;
|
||||
this.childrenWalkers[NodeType.Label] = ChildrenWalkers.walkLabelChildren;
|
||||
this.childrenWalkers[NodeType.LabeledStatement] = ChildrenWalkers.walkLabeledStatementChildren;
|
||||
this.childrenWalkers[NodeType.EBStart] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.GotoEB] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.EndCode] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Error] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Comment] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Debugger] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.None] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Empty] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.EmptyExpr] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.True] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.False] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.This] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Super] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.QString] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Regex] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Null] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.ArrayLit] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.ObjectLit] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Void] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Comma] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Pos] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Neg] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Delete] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Await] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.In] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Dot] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.From] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Is] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.InstOf] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Typeof] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.NumberLit] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Name] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.TypeRef] = ChildrenWalkers1.walkTypeReferenceChildren;
|
||||
this.childrenWalkers[NodeType.Index] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Call] = ChildrenWalkers1.walkCallExpressionChildren;
|
||||
this.childrenWalkers[NodeType.New] = ChildrenWalkers1.walkCallExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Asg] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgAdd] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgSub] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgDiv] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgMul] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgMod] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgAnd] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgXor] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgOr] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgLsh] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgRsh] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgRs2] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.ConditionalExpression] = ChildrenWalkers1.walkTrinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.LogOr] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.LogAnd] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Or] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Xor] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.And] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Eq] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Ne] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Eqv] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.NEqv] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Lt] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Le] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Gt] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Ge] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Add] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Sub] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Mul] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Div] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Mod] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Lsh] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Rsh] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Rs2] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Not] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.LogNot] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.IncPre] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.DecPre] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.IncPost] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.DecPost] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.TypeAssertion] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.FuncDecl] = ChildrenWalkers1.walkFuncDeclChildren;
|
||||
this.childrenWalkers[NodeType.Member] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.VarDecl] = ChildrenWalkers1.walkBoundDeclChildren;
|
||||
this.childrenWalkers[NodeType.ArgDecl] = ChildrenWalkers1.walkBoundDeclChildren;
|
||||
this.childrenWalkers[NodeType.Return] = ChildrenWalkers1.walkReturnStatementChildren;
|
||||
this.childrenWalkers[NodeType.Break] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Continue] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Throw] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.For] = ChildrenWalkers1.walkForStatementChildren;
|
||||
this.childrenWalkers[NodeType.ForIn] = ChildrenWalkers1.walkForInStatementChildren;
|
||||
this.childrenWalkers[NodeType.If] = ChildrenWalkers1.walkIfStatementChildren;
|
||||
this.childrenWalkers[NodeType.While] = ChildrenWalkers1.walkWhileStatementChildren;
|
||||
this.childrenWalkers[NodeType.DoWhile] = ChildrenWalkers1.walkDoWhileStatementChildren;
|
||||
this.childrenWalkers[NodeType.Block] = ChildrenWalkers1.walkBlockChildren;
|
||||
this.childrenWalkers[NodeType.Case] = ChildrenWalkers1.walkCaseStatementChildren;
|
||||
this.childrenWalkers[NodeType.Switch] = ChildrenWalkers1.walkSwitchStatementChildren;
|
||||
this.childrenWalkers[NodeType.Try] = ChildrenWalkers1.walkTryChildren;
|
||||
this.childrenWalkers[NodeType.TryCatch] = ChildrenWalkers1.walkTryCatchChildren;
|
||||
this.childrenWalkers[NodeType.TryFinally] = ChildrenWalkers1.walkTryFinallyChildren;
|
||||
this.childrenWalkers[NodeType.Finally] = ChildrenWalkers1.walkFinallyChildren;
|
||||
this.childrenWalkers[NodeType.Catch] = ChildrenWalkers1.walkCatchChildren;
|
||||
this.childrenWalkers[NodeType.List] = ChildrenWalkers1.walkListChildren;
|
||||
this.childrenWalkers[NodeType.Script] = ChildrenWalkers1.walkScriptChildren;
|
||||
this.childrenWalkers[NodeType.ClassDeclaration] = ChildrenWalkers1.walkClassDeclChildren;
|
||||
this.childrenWalkers[NodeType.InterfaceDeclaration] = ChildrenWalkers1.walkTypeDeclChildren;
|
||||
this.childrenWalkers[NodeType.ModuleDeclaration] = ChildrenWalkers1.walkModuleDeclChildren;
|
||||
this.childrenWalkers[NodeType.ImportDeclaration] = ChildrenWalkers1.walkImportDeclChildren;
|
||||
this.childrenWalkers[NodeType.With] = ChildrenWalkers1.walkWithStatementChildren;
|
||||
this.childrenWalkers[NodeType.Label] = ChildrenWalkers1.walkLabelChildren;
|
||||
this.childrenWalkers[NodeType.LabeledStatement] = ChildrenWalkers1.walkLabeledStatementChildren;
|
||||
this.childrenWalkers[NodeType.EBStart] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.GotoEB] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.EndCode] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Error] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Comment] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Debugger] = ChildrenWalkers1.walkNone;
|
||||
// Verify the code is up to date with the enum
|
||||
for(var e in NodeType._map){
|
||||
if (this.childrenWalkers[e] === undefined) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -87,113 +87,113 @@ var TypeScript;
|
||||
return new AstWalker(this.childrenWalkers, pre, post, options, state);
|
||||
};
|
||||
_proto.initChildrenWalkers = function initChildrenWalkers() {
|
||||
this.childrenWalkers[NodeType.None] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Empty] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.EmptyExpr] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.True] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.False] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.This] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Super] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.QString] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Regex] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Null] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.ArrayLit] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.ObjectLit] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Void] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Comma] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Pos] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Neg] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Delete] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Await] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.In] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Dot] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.From] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Is] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.InstOf] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Typeof] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.NumberLit] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Name] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.TypeRef] = ChildrenWalkers.walkTypeReferenceChildren;
|
||||
this.childrenWalkers[NodeType.Index] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Call] = ChildrenWalkers.walkCallExpressionChildren;
|
||||
this.childrenWalkers[NodeType.New] = ChildrenWalkers.walkCallExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Asg] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgAdd] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgSub] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgDiv] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgMul] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgMod] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgAnd] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgXor] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgOr] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgLsh] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgRsh] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgRs2] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.ConditionalExpression] = ChildrenWalkers.walkTrinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.LogOr] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.LogAnd] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Or] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Xor] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.And] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Eq] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Ne] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Eqv] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.NEqv] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Lt] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Le] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Gt] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Ge] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Add] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Sub] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Mul] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Div] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Mod] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Lsh] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Rsh] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Rs2] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Not] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.LogNot] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.IncPre] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.DecPre] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.IncPost] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.DecPost] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.TypeAssertion] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.FuncDecl] = ChildrenWalkers.walkFuncDeclChildren;
|
||||
this.childrenWalkers[NodeType.Member] = ChildrenWalkers.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.VarDecl] = ChildrenWalkers.walkBoundDeclChildren;
|
||||
this.childrenWalkers[NodeType.ArgDecl] = ChildrenWalkers.walkBoundDeclChildren;
|
||||
this.childrenWalkers[NodeType.Return] = ChildrenWalkers.walkReturnStatementChildren;
|
||||
this.childrenWalkers[NodeType.Break] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Continue] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Throw] = ChildrenWalkers.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.For] = ChildrenWalkers.walkForStatementChildren;
|
||||
this.childrenWalkers[NodeType.ForIn] = ChildrenWalkers.walkForInStatementChildren;
|
||||
this.childrenWalkers[NodeType.If] = ChildrenWalkers.walkIfStatementChildren;
|
||||
this.childrenWalkers[NodeType.While] = ChildrenWalkers.walkWhileStatementChildren;
|
||||
this.childrenWalkers[NodeType.DoWhile] = ChildrenWalkers.walkDoWhileStatementChildren;
|
||||
this.childrenWalkers[NodeType.Block] = ChildrenWalkers.walkBlockChildren;
|
||||
this.childrenWalkers[NodeType.Case] = ChildrenWalkers.walkCaseStatementChildren;
|
||||
this.childrenWalkers[NodeType.Switch] = ChildrenWalkers.walkSwitchStatementChildren;
|
||||
this.childrenWalkers[NodeType.Try] = ChildrenWalkers.walkTryChildren;
|
||||
this.childrenWalkers[NodeType.TryCatch] = ChildrenWalkers.walkTryCatchChildren;
|
||||
this.childrenWalkers[NodeType.TryFinally] = ChildrenWalkers.walkTryFinallyChildren;
|
||||
this.childrenWalkers[NodeType.Finally] = ChildrenWalkers.walkFinallyChildren;
|
||||
this.childrenWalkers[NodeType.Catch] = ChildrenWalkers.walkCatchChildren;
|
||||
this.childrenWalkers[NodeType.List] = ChildrenWalkers.walkListChildren;
|
||||
this.childrenWalkers[NodeType.Script] = ChildrenWalkers.walkScriptChildren;
|
||||
this.childrenWalkers[NodeType.ClassDeclaration] = ChildrenWalkers.walkClassDeclChildren;
|
||||
this.childrenWalkers[NodeType.InterfaceDeclaration] = ChildrenWalkers.walkTypeDeclChildren;
|
||||
this.childrenWalkers[NodeType.ModuleDeclaration] = ChildrenWalkers.walkModuleDeclChildren;
|
||||
this.childrenWalkers[NodeType.ImportDeclaration] = ChildrenWalkers.walkImportDeclChildren;
|
||||
this.childrenWalkers[NodeType.With] = ChildrenWalkers.walkWithStatementChildren;
|
||||
this.childrenWalkers[NodeType.Label] = ChildrenWalkers.walkLabelChildren;
|
||||
this.childrenWalkers[NodeType.LabeledStatement] = ChildrenWalkers.walkLabeledStatementChildren;
|
||||
this.childrenWalkers[NodeType.EBStart] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.GotoEB] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.EndCode] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Error] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Comment] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.Debugger] = ChildrenWalkers.walkNone;
|
||||
this.childrenWalkers[NodeType.None] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Empty] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.EmptyExpr] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.True] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.False] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.This] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Super] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.QString] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Regex] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Null] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.ArrayLit] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.ObjectLit] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Void] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Comma] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Pos] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Neg] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Delete] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Await] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.In] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Dot] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.From] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Is] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.InstOf] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Typeof] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.NumberLit] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Name] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.TypeRef] = ChildrenWalkers1.walkTypeReferenceChildren;
|
||||
this.childrenWalkers[NodeType.Index] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Call] = ChildrenWalkers1.walkCallExpressionChildren;
|
||||
this.childrenWalkers[NodeType.New] = ChildrenWalkers1.walkCallExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Asg] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgAdd] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgSub] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgDiv] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgMul] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgMod] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgAnd] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgXor] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgOr] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgLsh] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgRsh] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.AsgRs2] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.ConditionalExpression] = ChildrenWalkers1.walkTrinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.LogOr] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.LogAnd] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Or] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Xor] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.And] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Eq] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Ne] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Eqv] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.NEqv] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Lt] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Le] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Gt] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Ge] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Add] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Sub] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Mul] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Div] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Mod] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Lsh] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Rsh] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Rs2] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.Not] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.LogNot] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.IncPre] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.DecPre] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.IncPost] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.DecPost] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.TypeAssertion] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.FuncDecl] = ChildrenWalkers1.walkFuncDeclChildren;
|
||||
this.childrenWalkers[NodeType.Member] = ChildrenWalkers1.walkBinaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.VarDecl] = ChildrenWalkers1.walkBoundDeclChildren;
|
||||
this.childrenWalkers[NodeType.ArgDecl] = ChildrenWalkers1.walkBoundDeclChildren;
|
||||
this.childrenWalkers[NodeType.Return] = ChildrenWalkers1.walkReturnStatementChildren;
|
||||
this.childrenWalkers[NodeType.Break] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Continue] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Throw] = ChildrenWalkers1.walkUnaryExpressionChildren;
|
||||
this.childrenWalkers[NodeType.For] = ChildrenWalkers1.walkForStatementChildren;
|
||||
this.childrenWalkers[NodeType.ForIn] = ChildrenWalkers1.walkForInStatementChildren;
|
||||
this.childrenWalkers[NodeType.If] = ChildrenWalkers1.walkIfStatementChildren;
|
||||
this.childrenWalkers[NodeType.While] = ChildrenWalkers1.walkWhileStatementChildren;
|
||||
this.childrenWalkers[NodeType.DoWhile] = ChildrenWalkers1.walkDoWhileStatementChildren;
|
||||
this.childrenWalkers[NodeType.Block] = ChildrenWalkers1.walkBlockChildren;
|
||||
this.childrenWalkers[NodeType.Case] = ChildrenWalkers1.walkCaseStatementChildren;
|
||||
this.childrenWalkers[NodeType.Switch] = ChildrenWalkers1.walkSwitchStatementChildren;
|
||||
this.childrenWalkers[NodeType.Try] = ChildrenWalkers1.walkTryChildren;
|
||||
this.childrenWalkers[NodeType.TryCatch] = ChildrenWalkers1.walkTryCatchChildren;
|
||||
this.childrenWalkers[NodeType.TryFinally] = ChildrenWalkers1.walkTryFinallyChildren;
|
||||
this.childrenWalkers[NodeType.Finally] = ChildrenWalkers1.walkFinallyChildren;
|
||||
this.childrenWalkers[NodeType.Catch] = ChildrenWalkers1.walkCatchChildren;
|
||||
this.childrenWalkers[NodeType.List] = ChildrenWalkers1.walkListChildren;
|
||||
this.childrenWalkers[NodeType.Script] = ChildrenWalkers1.walkScriptChildren;
|
||||
this.childrenWalkers[NodeType.ClassDeclaration] = ChildrenWalkers1.walkClassDeclChildren;
|
||||
this.childrenWalkers[NodeType.InterfaceDeclaration] = ChildrenWalkers1.walkTypeDeclChildren;
|
||||
this.childrenWalkers[NodeType.ModuleDeclaration] = ChildrenWalkers1.walkModuleDeclChildren;
|
||||
this.childrenWalkers[NodeType.ImportDeclaration] = ChildrenWalkers1.walkImportDeclChildren;
|
||||
this.childrenWalkers[NodeType.With] = ChildrenWalkers1.walkWithStatementChildren;
|
||||
this.childrenWalkers[NodeType.Label] = ChildrenWalkers1.walkLabelChildren;
|
||||
this.childrenWalkers[NodeType.LabeledStatement] = ChildrenWalkers1.walkLabeledStatementChildren;
|
||||
this.childrenWalkers[NodeType.EBStart] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.GotoEB] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.EndCode] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Error] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Comment] = ChildrenWalkers1.walkNone;
|
||||
this.childrenWalkers[NodeType.Debugger] = ChildrenWalkers1.walkNone;
|
||||
// Verify the code is up to date with the enum
|
||||
for(var e in NodeType._map){
|
||||
if (this.childrenWalkers[e] === undefined) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -1645,6 +1645,19 @@ impl VisitMut for Hoister<'_, '_> {
|
||||
self.resolver.in_type = old_in_type;
|
||||
}
|
||||
}
|
||||
|
||||
Decl::TsModule(TsModuleDecl {
|
||||
global: false,
|
||||
id: TsModuleName::Ident(id),
|
||||
..
|
||||
}) => {
|
||||
if !self.in_block {
|
||||
let old_in_type = self.resolver.in_type;
|
||||
self.resolver.in_type = false;
|
||||
self.resolver.modify(id, None);
|
||||
self.resolver.in_type = old_in_type;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
#![allow(unused_imports)]
|
||||
#![allow(unused_variables)]
|
||||
#[cfg(feature = "plugin-mode")]
|
||||
use swc_common::{
|
||||
|
Loading…
Reference in New Issue
Block a user