mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Added tests for 1.0 lib and missing decorator type
This commit is contained in:
1 parent
a9e79bf06b
commit
ed644ddaa1
7 files changed
+6560
No files matched your search
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
@@ -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 {
|
||||
}
|
||||
|
||||
|
||||
@@ -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
@@ -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 {
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user