Added tests for 1.0 lib and missing decorator type

This commit is contained in:
Ron Buckton 2015-04-23 12:33:12 -07:00
parent a5eb68bcbb
commit e08e1f145b
7 changed files with 6560 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
error TS2318: Cannot find global type 'ClassDecorator'.
!!! error TS2318: Cannot find global type 'ClassDecorator'.
==== tests/cases/conformance/decorators/a.ts (0 errors) ====
interface Object { }
interface Array<T> { }
interface String { }
interface Boolean { }
interface Number { }
interface Function { }
interface RegExp { }
interface IArguments { }
==== tests/cases/conformance/decorators/b.ts (0 errors) ====
declare var dec: any;
@dec
class C {
}

View File

@ -0,0 +1,40 @@
//// [tests/cases/conformance/decorators/missingDecoratorType.ts] ////
//// [a.ts]
interface Object { }
interface Array<T> { }
interface String { }
interface Boolean { }
interface Number { }
interface Function { }
interface RegExp { }
interface IArguments { }
//// [b.ts]
declare var dec: any;
@dec
class C {
}
//// [a.js]
//// [b.js]
var __decorate = this.__decorate || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
var C = (function () {
function C() {
}
C = __decorate([
dec
], C);
return C;
})();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,21 @@
// @target: ES5
// @noLib: true
// @Filename: a.ts
interface Object { }
interface Array<T> { }
interface String { }
interface Boolean { }
interface Number { }
interface Function { }
interface RegExp { }
interface IArguments { }
// @Filename: b.ts
/// <reference path="a.ts" />
declare var dec: any;
@dec
class C {
}