Added tests for 1.0 lib and missing decorator type
This commit is contained in:
parent
a9e79bf06b
commit
ed644ddaa1
1160
tests/baselines/reference/1.0lib-noErrors.js
Normal file
1160
tests/baselines/reference/1.0lib-noErrors.js
Normal file
File diff suppressed because it is too large
Load diff
2086
tests/baselines/reference/1.0lib-noErrors.symbols
Normal file
2086
tests/baselines/reference/1.0lib-noErrors.symbols
Normal file
File diff suppressed because it is too large
Load diff
2086
tests/baselines/reference/1.0lib-noErrors.types
Normal file
2086
tests/baselines/reference/1.0lib-noErrors.types
Normal file
File diff suppressed because it is too large
Load diff
23
tests/baselines/reference/missingDecoratorType.errors.txt
Normal file
23
tests/baselines/reference/missingDecoratorType.errors.txt
Normal 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 {
|
||||
}
|
||||
|
||||
|
40
tests/baselines/reference/missingDecoratorType.js
Normal file
40
tests/baselines/reference/missingDecoratorType.js
Normal 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;
|
||||
})();
|
1144
tests/cases/conformance/decorators/1.0lib-noErrors.ts
Normal file
1144
tests/cases/conformance/decorators/1.0lib-noErrors.ts
Normal file
File diff suppressed because it is too large
Load diff
21
tests/cases/conformance/decorators/missingDecoratorType.ts
Normal file
21
tests/cases/conformance/decorators/missingDecoratorType.ts
Normal 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 {
|
||||
}
|
||||
|
Loading…
Reference in a new issue