Added tests for issue #3932

This commit is contained in:
pcan 2015-07-25 10:01:39 +02:00
parent bcf89e89e6
commit 6895237f9a
4 changed files with 94 additions and 0 deletions

View File

@ -0,0 +1,31 @@
//// [emitVoid0ReturnType.ts]
declare var decorator: any;
class MyClass {
constructor(test: string, test2: number) {
}
@decorator
doSomething() {
}
}
//// [emitVoid0ReturnType.js]
var MyClass = (function () {
function MyClass(test, test2) {
}
MyClass.prototype.doSomething = function () {
};
Object.defineProperty(MyClass.prototype, "doSomething",
__decorate([
decorator,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], MyClass.prototype, "doSomething", Object.getOwnPropertyDescriptor(MyClass.prototype, "doSomething")));
return MyClass;
})();

View File

@ -0,0 +1,23 @@
=== tests/cases/compiler/emitVoid0ReturnType.ts ===
declare var decorator: any;
>decorator : Symbol(decorator, Decl(emitVoid0ReturnType.ts, 1, 11))
class MyClass {
>MyClass : Symbol(MyClass, Decl(emitVoid0ReturnType.ts, 1, 27))
constructor(test: string, test2: number) {
>test : Symbol(test, Decl(emitVoid0ReturnType.ts, 4, 16))
>test2 : Symbol(test2, Decl(emitVoid0ReturnType.ts, 4, 29))
}
@decorator
>decorator : Symbol(decorator, Decl(emitVoid0ReturnType.ts, 1, 11))
doSomething() {
>doSomething : Symbol(doSomething, Decl(emitVoid0ReturnType.ts, 6, 5))
}
}

View File

@ -0,0 +1,23 @@
=== tests/cases/compiler/emitVoid0ReturnType.ts ===
declare var decorator: any;
>decorator : any
class MyClass {
>MyClass : MyClass
constructor(test: string, test2: number) {
>test : string
>test2 : number
}
@decorator
>decorator : any
doSomething() {
>doSomething : () => void
}
}

View File

@ -0,0 +1,17 @@
// @noemithelpers: true
// @experimentaldecorators: true
// @emitdecoratormetadata: true
// @target: es5
declare var decorator: any;
class MyClass {
constructor(test: string, test2: number) {
}
@decorator
doSomething() {
}
}