mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
More
This commit is contained in:
@@ -327,11 +327,7 @@ export function transformLegacyDecorators(context: TransformationContext): (x: S
|
||||
const location = moveRangePastModifiers(node);
|
||||
const classAlias = getClassAliasIfNeeded(node);
|
||||
|
||||
// When we transform to ES5/3 this will be moved inside an IIFE and should reference the name
|
||||
// without any block-scoped variable collision handling
|
||||
const declName = languageVersion < ScriptTarget.ES2015 ?
|
||||
factory.getInternalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true) :
|
||||
factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true);
|
||||
const declName = factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true);
|
||||
|
||||
// ... = class ${name} ${heritageClauses} {
|
||||
// ${members}
|
||||
@@ -687,11 +683,7 @@ export function transformLegacyDecorators(context: TransformationContext): (x: S
|
||||
|
||||
const classAlias = classAliases && classAliases[getOriginalNodeId(node)];
|
||||
|
||||
// When we transform to ES5/3 this will be moved inside an IIFE and should reference the name
|
||||
// without any block-scoped variable collision handling
|
||||
const localName = languageVersion < ScriptTarget.ES2015 ?
|
||||
factory.getInternalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true) :
|
||||
factory.getDeclarationName(node, /*allowComments*/ false, /*allowSourceMaps*/ true);
|
||||
const localName = factory.getDeclarationName(node, /*allowComments*/ false, /*allowSourceMaps*/ true);
|
||||
const decorate = emitHelpers().createDecorateHelper(decoratorExpressions, localName);
|
||||
const expression = factory.createAssignment(localName, classAlias ? factory.createAssignment(classAlias, decorate) : decorate);
|
||||
setEmitFlags(expression, EmitFlags.NoComments);
|
||||
|
||||
@@ -95,7 +95,7 @@ let ClassA = (() => {
|
||||
__metadata("design:paramtypes", [aux1_1.SomeClass1]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ClassA.prototype, "foo", null);
|
||||
ClassA = __decorate([
|
||||
exports.ClassA = ClassA = __decorate([
|
||||
annotation(),
|
||||
__metadata("design:paramtypes", [aux_1.SomeClass])
|
||||
], ClassA);
|
||||
|
||||
@@ -47,7 +47,7 @@ let MyClass = (() => {
|
||||
this.db.doSomething();
|
||||
}
|
||||
};
|
||||
MyClass = __decorate([
|
||||
exports.MyClass = MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata("design:paramtypes", [db_1.db])
|
||||
], MyClass);
|
||||
|
||||
@@ -47,7 +47,7 @@ let MyClass = (() => {
|
||||
this.db.doSomething();
|
||||
}
|
||||
};
|
||||
MyClass = __decorate([
|
||||
exports.MyClass = MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata("design:paramtypes", [db_1.db])
|
||||
], MyClass);
|
||||
|
||||
@@ -47,7 +47,7 @@ let MyClass = (() => {
|
||||
this.db.doSomething();
|
||||
}
|
||||
};
|
||||
MyClass = __decorate([
|
||||
exports.MyClass = MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata("design:paramtypes", [db.db])
|
||||
], MyClass);
|
||||
|
||||
@@ -48,7 +48,7 @@ let MyClass = (() => {
|
||||
this.db.doSomething();
|
||||
}
|
||||
};
|
||||
MyClass = __decorate([
|
||||
exports.MyClass = MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof db_1.default !== "undefined" && db_1.default.db) === "function" ? _a : Object])
|
||||
], MyClass);
|
||||
|
||||
@@ -46,7 +46,7 @@ let MyClass = (() => {
|
||||
this.db.doSomething();
|
||||
}
|
||||
};
|
||||
MyClass = __decorate([
|
||||
exports.MyClass = MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata("design:paramtypes", [db_1.default])
|
||||
], MyClass);
|
||||
|
||||
@@ -46,7 +46,7 @@ let MyClass = (() => {
|
||||
this.db.doSomething();
|
||||
}
|
||||
};
|
||||
MyClass = __decorate([
|
||||
exports.MyClass = MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata("design:paramtypes", [db_1.default])
|
||||
], MyClass);
|
||||
|
||||
@@ -47,7 +47,7 @@ let MyClass = (() => {
|
||||
this.db.doSomething();
|
||||
}
|
||||
};
|
||||
MyClass = __decorate([
|
||||
exports.MyClass = MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof db_1.default !== "undefined" && db_1.default.db) === "function" ? _a : Object])
|
||||
], MyClass);
|
||||
|
||||
@@ -47,7 +47,7 @@ let MyClass = (() => {
|
||||
this.db.doSomething();
|
||||
}
|
||||
};
|
||||
MyClass = __decorate([
|
||||
exports.MyClass = MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata("design:paramtypes", [database.db])
|
||||
], MyClass);
|
||||
|
||||
@@ -20,7 +20,7 @@ exports.C = void 0;
|
||||
let C = (() => {
|
||||
let C = class C {
|
||||
};
|
||||
C = __decorate([
|
||||
exports.C = C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
return C;
|
||||
|
||||
@@ -21,7 +21,7 @@ exports.C = void 0;
|
||||
let C = (() => {
|
||||
let C = class C {
|
||||
};
|
||||
C = __decorate([
|
||||
exports.C = C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
return C;
|
||||
|
||||
@@ -43,7 +43,7 @@ let C = (() => {
|
||||
super();
|
||||
}
|
||||
};
|
||||
C = __decorate([
|
||||
exports.C = C = __decorate([
|
||||
__param(0, _0_ts_2.foo)
|
||||
], C);
|
||||
return C;
|
||||
|
||||
@@ -46,7 +46,7 @@ let C = (() => {
|
||||
super();
|
||||
}
|
||||
};
|
||||
C = __decorate([
|
||||
exports.C = C = __decorate([
|
||||
__param(0, _0_2.foo)
|
||||
], C);
|
||||
return C;
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ define(["require", "exports", "angular2/core"], function (require, exports, ng)
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
};
|
||||
MyClass1 = __decorate([
|
||||
exports.MyClass1 = MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object])
|
||||
], MyClass1);
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ let MyClass1 = (() => {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
};
|
||||
MyClass1 = __decorate([
|
||||
exports.MyClass1 = MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object])
|
||||
], MyClass1);
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ define(["require", "exports", "angular2/core"], function (require, exports, ng)
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
};
|
||||
MyClass1 = __decorate([
|
||||
exports.MyClass1 = MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object])
|
||||
], MyClass1);
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ let MyClass1 = (() => {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
};
|
||||
MyClass1 = __decorate([
|
||||
exports.MyClass1 = MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object])
|
||||
], MyClass1);
|
||||
|
||||
@@ -18,7 +18,7 @@ define(["require", "exports", "angular2/core"], function (require, exports, ng)
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
};
|
||||
MyClass1 = __decorate([
|
||||
exports.MyClass1 = MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object])
|
||||
], MyClass1);
|
||||
|
||||
@@ -18,7 +18,7 @@ let MyClass1 = (() => {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
};
|
||||
MyClass1 = __decorate([
|
||||
exports.MyClass1 = MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object])
|
||||
], MyClass1);
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ define(["require", "exports", "angular2/core"], function (require, exports, ng)
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
};
|
||||
MyClass1 = __decorate([
|
||||
exports.MyClass1 = MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object])
|
||||
], MyClass1);
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ let MyClass1 = (() => {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
};
|
||||
MyClass1 = __decorate([
|
||||
exports.MyClass1 = MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object])
|
||||
], MyClass1);
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ define(["require", "exports", "angular2/core"], function (require, exports, ng)
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
};
|
||||
MyClass1 = __decorate([
|
||||
exports.MyClass1 = MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object])
|
||||
], MyClass1);
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ let MyClass1 = (() => {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
};
|
||||
MyClass1 = __decorate([
|
||||
exports.MyClass1 = MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object])
|
||||
], MyClass1);
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ let MyClass = (() => {
|
||||
this.db.doSomething();
|
||||
}
|
||||
};
|
||||
MyClass = __decorate([
|
||||
exports.MyClass = MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof db_1.db !== "undefined" && db_1.db) === "function" ? _a : Object])
|
||||
], MyClass);
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ let MyClass = (() => {
|
||||
this.db.doSomething();
|
||||
}
|
||||
};
|
||||
MyClass = __decorate([
|
||||
exports.MyClass = MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof db_1.db !== "undefined" && db_1.db) === "function" ? _a : Object])
|
||||
], MyClass);
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ let MyClass = (() => {
|
||||
this.db.doSomething();
|
||||
}
|
||||
};
|
||||
MyClass = __decorate([
|
||||
exports.MyClass = MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof db_1.db !== "undefined" && db_1.db) === "function" ? _a : Object])
|
||||
], MyClass);
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ let MyClass = (() => {
|
||||
this.db.doSomething();
|
||||
}
|
||||
};
|
||||
MyClass = __decorate([
|
||||
exports.MyClass = MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof db_1.db !== "undefined" && db_1.db) === "function" ? _a : Object])
|
||||
], MyClass);
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ exports.C = void 0;
|
||||
let C = (() => {
|
||||
let C = class C {
|
||||
};
|
||||
C = __decorate([
|
||||
exports.C = C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
return C;
|
||||
|
||||
+2
-2
@@ -25,9 +25,9 @@ System.register([], function (exports_1, context_1) {
|
||||
C = (() => {
|
||||
let C = class C {
|
||||
};
|
||||
C = __decorate([
|
||||
exports_1("C", C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
], C));
|
||||
return C;
|
||||
})();
|
||||
exports_1("C", C);
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ exports.D = void 0;
|
||||
let C = (() => {
|
||||
let C = class C {
|
||||
};
|
||||
C = __decorate([
|
||||
exports.D = C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
return C;
|
||||
|
||||
+2
-2
@@ -25,9 +25,9 @@ System.register([], function (exports_1, context_1) {
|
||||
C = (() => {
|
||||
let C = class C {
|
||||
};
|
||||
C = __decorate([
|
||||
exports_1("D", C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
], C));
|
||||
return C;
|
||||
})();
|
||||
exports_1("D", C);
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ try {
|
||||
exports.C = C = (() => {
|
||||
let C = class C {
|
||||
};
|
||||
C = __decorate([
|
||||
exports.C = C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
return C;
|
||||
|
||||
+2
-2
@@ -26,9 +26,9 @@ System.register([], function (exports_1, context_1) {
|
||||
exports_1("C", C = (() => {
|
||||
let C = class C {
|
||||
};
|
||||
C = __decorate([
|
||||
exports_1("C", C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
], C));
|
||||
return C;
|
||||
})());
|
||||
}
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ try {
|
||||
exports.C = C = (() => {
|
||||
let C = class C {
|
||||
};
|
||||
C = __decorate([
|
||||
exports.C = C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
return C;
|
||||
|
||||
+2
-2
@@ -27,9 +27,9 @@ System.register([], function (exports_1, context_1) {
|
||||
exports_1("C", C = (() => {
|
||||
let C = class C {
|
||||
};
|
||||
C = __decorate([
|
||||
exports_1("C", C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
], C));
|
||||
return C;
|
||||
})());
|
||||
}
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ try {
|
||||
exports.D = C = (() => {
|
||||
let C = class C {
|
||||
};
|
||||
C = __decorate([
|
||||
exports.D = C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
return C;
|
||||
|
||||
+2
-2
@@ -27,9 +27,9 @@ System.register([], function (exports_1, context_1) {
|
||||
exports_1("D", C = (() => {
|
||||
let C = class C {
|
||||
};
|
||||
C = __decorate([
|
||||
exports_1("D", C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
], C));
|
||||
return C;
|
||||
})());
|
||||
}
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ exports.C = void 0;
|
||||
let C = (() => {
|
||||
let C = class C {
|
||||
};
|
||||
C = __decorate([
|
||||
exports.C = C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
return C;
|
||||
|
||||
+2
-2
@@ -23,9 +23,9 @@ System.register([], function (exports_1, context_1) {
|
||||
C = (() => {
|
||||
let C = class C {
|
||||
};
|
||||
C = __decorate([
|
||||
exports_1("C", C = __decorate([
|
||||
dec
|
||||
], C);
|
||||
], C));
|
||||
return C;
|
||||
})();
|
||||
exports_1("C", C);
|
||||
|
||||
Reference in New Issue
Block a user