Add tests and baselines

This commit is contained in:
Yui T 2016-09-07 13:55:02 -07:00
parent 60b382d1b3
commit 7d91ac808b
4 changed files with 120 additions and 0 deletions

View File

@ -0,0 +1,47 @@
//// [commentOnDecoratedClassDeclaration.ts]
declare function decorator(x: string): any;
/**
* Leading trivia
*/
@decorator("hello")
class Remote { }
/**
* Floating Comment
*/
@decorator("hi")
class AnotherRomote {
constructor() {}
}
//// [commentOnDecoratedClassDeclaration.js]
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/**
* Leading trivia
*/
var Remote = (function () {
function Remote() {
}
return Remote;
}());
Remote = __decorate([
decorator("hello")
], Remote);
/**
* Floating Comment
*/
var AnotherRomote = (function () {
function AnotherRomote() {
}
return AnotherRomote;
}());
AnotherRomote = __decorate([
decorator("hi")
], AnotherRomote);

View File

@ -0,0 +1,26 @@
=== tests/cases/compiler/commentOnDecoratedClassDeclaration.ts ===
declare function decorator(x: string): any;
>decorator : Symbol(decorator, Decl(commentOnDecoratedClassDeclaration.ts, 0, 0))
>x : Symbol(x, Decl(commentOnDecoratedClassDeclaration.ts, 0, 27))
/**
* Leading trivia
*/
@decorator("hello")
>decorator : Symbol(decorator, Decl(commentOnDecoratedClassDeclaration.ts, 0, 0))
class Remote { }
>Remote : Symbol(Remote, Decl(commentOnDecoratedClassDeclaration.ts, 0, 43))
/**
* Floating Comment
*/
@decorator("hi")
>decorator : Symbol(decorator, Decl(commentOnDecoratedClassDeclaration.ts, 0, 0))
class AnotherRomote {
>AnotherRomote : Symbol(AnotherRomote, Decl(commentOnDecoratedClassDeclaration.ts, 6, 16))
constructor() {}
}

View File

@ -0,0 +1,30 @@
=== tests/cases/compiler/commentOnDecoratedClassDeclaration.ts ===
declare function decorator(x: string): any;
>decorator : (x: string) => any
>x : string
/**
* Leading trivia
*/
@decorator("hello")
>decorator("hello") : any
>decorator : (x: string) => any
>"hello" : string
class Remote { }
>Remote : Remote
/**
* Floating Comment
*/
@decorator("hi")
>decorator("hi") : any
>decorator : (x: string) => any
>"hi" : string
class AnotherRomote {
>AnotherRomote : AnotherRomote
constructor() {}
}

View File

@ -0,0 +1,17 @@
// @experimentalDecorators: true
declare function decorator(x: string): any;
/**
* Leading trivia
*/
@decorator("hello")
class Remote { }
/**
* Floating Comment
*/
@decorator("hi")
class AnotherRomote {
constructor() {}
}