diff --git a/tests/baselines/reference/importHelpers.js b/tests/baselines/reference/importHelpers.js index 52e07fb98bb..f850b5cf177 100644 --- a/tests/baselines/reference/importHelpers.js +++ b/tests/baselines/reference/importHelpers.js @@ -22,7 +22,16 @@ declare var dec: any; class C { method(@dec x: number) { } -} +} + +//// [tslib.d.ts] +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; + //// [external.js] "use strict"; diff --git a/tests/baselines/reference/importHelpers.symbols b/tests/baselines/reference/importHelpers.symbols index cb852ab286c..55ca5153e32 100644 --- a/tests/baselines/reference/importHelpers.symbols +++ b/tests/baselines/reference/importHelpers.symbols @@ -45,3 +45,47 @@ class C { >x : Symbol(x, Decl(script.ts, 7, 11)) } } + +=== tests/cases/compiler/tslib.d.ts === +export declare function __extends(d: Function, b: Function): void; +>__extends : Symbol(__extends, Decl(tslib.d.ts, --, --)) +>d : Symbol(d, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>b : Symbol(b, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __assign(t: any, ...sources: any[]): any; +>__assign : Symbol(__assign, Decl(tslib.d.ts, --, --)) +>t : Symbol(t, Decl(tslib.d.ts, --, --)) +>sources : Symbol(sources, Decl(tslib.d.ts, --, --)) + +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +>__decorate : Symbol(__decorate, Decl(tslib.d.ts, --, --)) +>decorators : Symbol(decorators, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>target : Symbol(target, Decl(tslib.d.ts, --, --)) +>key : Symbol(key, Decl(tslib.d.ts, --, --)) +>desc : Symbol(desc, Decl(tslib.d.ts, --, --)) + +export declare function __param(paramIndex: number, decorator: Function): Function; +>__param : Symbol(__param, Decl(tslib.d.ts, --, --)) +>paramIndex : Symbol(paramIndex, Decl(tslib.d.ts, --, --)) +>decorator : Symbol(decorator, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +>__metadata : Symbol(__metadata, Decl(tslib.d.ts, --, --)) +>metadataKey : Symbol(metadataKey, Decl(tslib.d.ts, --, --)) +>metadataValue : Symbol(metadataValue, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +>__awaiter : Symbol(__awaiter, Decl(tslib.d.ts, --, --)) +>thisArg : Symbol(thisArg, Decl(tslib.d.ts, --, --)) +>_arguments : Symbol(_arguments, Decl(tslib.d.ts, --, --)) +>P : Symbol(P, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>generator : Symbol(generator, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/importHelpers.types b/tests/baselines/reference/importHelpers.types index 0d1cda653e8..0ab8d40ee85 100644 --- a/tests/baselines/reference/importHelpers.types +++ b/tests/baselines/reference/importHelpers.types @@ -45,3 +45,47 @@ class C { >x : number } } + +=== tests/cases/compiler/tslib.d.ts === +export declare function __extends(d: Function, b: Function): void; +>__extends : (d: Function, b: Function) => void +>d : Function +>Function : Function +>b : Function +>Function : Function + +export declare function __assign(t: any, ...sources: any[]): any; +>__assign : (t: any, ...sources: any[]) => any +>t : any +>sources : any[] + +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +>__decorate : (decorators: Function[], target: any, key?: string | symbol, desc?: any) => any +>decorators : Function[] +>Function : Function +>target : any +>key : string | symbol +>desc : any + +export declare function __param(paramIndex: number, decorator: Function): Function; +>__param : (paramIndex: number, decorator: Function) => Function +>paramIndex : number +>decorator : Function +>Function : Function +>Function : Function + +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +>__metadata : (metadataKey: any, metadataValue: any) => Function +>metadataKey : any +>metadataValue : any +>Function : Function + +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +>__awaiter : (thisArg: any, _arguments: any, P: Function, generator: Function) => any +>thisArg : any +>_arguments : any +>P : Function +>Function : Function +>generator : Function +>Function : Function + diff --git a/tests/baselines/reference/importHelpersAmd.js b/tests/baselines/reference/importHelpersAmd.js index e5f6bdce278..bb02cbf0417 100644 --- a/tests/baselines/reference/importHelpersAmd.js +++ b/tests/baselines/reference/importHelpersAmd.js @@ -1,11 +1,20 @@ //// [tests/cases/compiler/importHelpersAmd.ts] //// //// [a.ts] -export class A { } +export class A { } + //// [b.ts] import { A } from "./a"; export class B extends A { } +//// [tslib.d.ts] +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; + //// [a.js] define(["require", "exports"], function (require, exports) { diff --git a/tests/baselines/reference/importHelpersAmd.symbols b/tests/baselines/reference/importHelpersAmd.symbols index d4155c4bf52..47528a8bba6 100644 --- a/tests/baselines/reference/importHelpersAmd.symbols +++ b/tests/baselines/reference/importHelpersAmd.symbols @@ -10,3 +10,46 @@ export class B extends A { } >B : Symbol(B, Decl(b.ts, 0, 24)) >A : Symbol(A, Decl(b.ts, 0, 8)) +=== tests/cases/compiler/tslib.d.ts === +export declare function __extends(d: Function, b: Function): void; +>__extends : Symbol(__extends, Decl(tslib.d.ts, --, --)) +>d : Symbol(d, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>b : Symbol(b, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __assign(t: any, ...sources: any[]): any; +>__assign : Symbol(__assign, Decl(tslib.d.ts, --, --)) +>t : Symbol(t, Decl(tslib.d.ts, --, --)) +>sources : Symbol(sources, Decl(tslib.d.ts, --, --)) + +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +>__decorate : Symbol(__decorate, Decl(tslib.d.ts, --, --)) +>decorators : Symbol(decorators, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>target : Symbol(target, Decl(tslib.d.ts, --, --)) +>key : Symbol(key, Decl(tslib.d.ts, --, --)) +>desc : Symbol(desc, Decl(tslib.d.ts, --, --)) + +export declare function __param(paramIndex: number, decorator: Function): Function; +>__param : Symbol(__param, Decl(tslib.d.ts, --, --)) +>paramIndex : Symbol(paramIndex, Decl(tslib.d.ts, --, --)) +>decorator : Symbol(decorator, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +>__metadata : Symbol(__metadata, Decl(tslib.d.ts, --, --)) +>metadataKey : Symbol(metadataKey, Decl(tslib.d.ts, --, --)) +>metadataValue : Symbol(metadataValue, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +>__awaiter : Symbol(__awaiter, Decl(tslib.d.ts, --, --)) +>thisArg : Symbol(thisArg, Decl(tslib.d.ts, --, --)) +>_arguments : Symbol(_arguments, Decl(tslib.d.ts, --, --)) +>P : Symbol(P, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>generator : Symbol(generator, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/importHelpersAmd.types b/tests/baselines/reference/importHelpersAmd.types index 7f313d87cd6..9ff756ffaab 100644 --- a/tests/baselines/reference/importHelpersAmd.types +++ b/tests/baselines/reference/importHelpersAmd.types @@ -10,3 +10,46 @@ export class B extends A { } >B : B >A : A +=== tests/cases/compiler/tslib.d.ts === +export declare function __extends(d: Function, b: Function): void; +>__extends : (d: Function, b: Function) => void +>d : Function +>Function : Function +>b : Function +>Function : Function + +export declare function __assign(t: any, ...sources: any[]): any; +>__assign : (t: any, ...sources: any[]) => any +>t : any +>sources : any[] + +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +>__decorate : (decorators: Function[], target: any, key?: string | symbol, desc?: any) => any +>decorators : Function[] +>Function : Function +>target : any +>key : string | symbol +>desc : any + +export declare function __param(paramIndex: number, decorator: Function): Function; +>__param : (paramIndex: number, decorator: Function) => Function +>paramIndex : number +>decorator : Function +>Function : Function +>Function : Function + +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +>__metadata : (metadataKey: any, metadataValue: any) => Function +>metadataKey : any +>metadataValue : any +>Function : Function + +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +>__awaiter : (thisArg: any, _arguments: any, P: Function, generator: Function) => any +>thisArg : any +>_arguments : any +>P : Function +>Function : Function +>generator : Function +>Function : Function + diff --git a/tests/baselines/reference/importHelpersES6.js b/tests/baselines/reference/importHelpersES6.js index c9709986853..209f3c34588 100644 --- a/tests/baselines/reference/importHelpersES6.js +++ b/tests/baselines/reference/importHelpersES6.js @@ -1,8 +1,19 @@ +//// [tests/cases/compiler/importHelpersES6.ts] //// + //// [a.ts] declare var dec: any; @dec export class A { -} +} + +//// [tslib.d.ts] +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; + //// [a.js] import * as tslib_1 from "tslib"; diff --git a/tests/baselines/reference/importHelpersES6.symbols b/tests/baselines/reference/importHelpersES6.symbols index 66d3cd62c41..284a2251a6b 100644 --- a/tests/baselines/reference/importHelpersES6.symbols +++ b/tests/baselines/reference/importHelpersES6.symbols @@ -7,3 +7,47 @@ declare var dec: any; >A : Symbol(A, Decl(a.ts, 0, 21)) } + +=== tests/cases/compiler/tslib.d.ts === +export declare function __extends(d: Function, b: Function): void; +>__extends : Symbol(__extends, Decl(tslib.d.ts, --, --)) +>d : Symbol(d, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>b : Symbol(b, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) + +export declare function __assign(t: any, ...sources: any[]): any; +>__assign : Symbol(__assign, Decl(tslib.d.ts, --, --)) +>t : Symbol(t, Decl(tslib.d.ts, --, --)) +>sources : Symbol(sources, Decl(tslib.d.ts, --, --)) + +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +>__decorate : Symbol(__decorate, Decl(tslib.d.ts, --, --)) +>decorators : Symbol(decorators, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>target : Symbol(target, Decl(tslib.d.ts, --, --)) +>key : Symbol(key, Decl(tslib.d.ts, --, --)) +>desc : Symbol(desc, Decl(tslib.d.ts, --, --)) + +export declare function __param(paramIndex: number, decorator: Function): Function; +>__param : Symbol(__param, Decl(tslib.d.ts, --, --)) +>paramIndex : Symbol(paramIndex, Decl(tslib.d.ts, --, --)) +>decorator : Symbol(decorator, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) + +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +>__metadata : Symbol(__metadata, Decl(tslib.d.ts, --, --)) +>metadataKey : Symbol(metadataKey, Decl(tslib.d.ts, --, --)) +>metadataValue : Symbol(metadataValue, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) + +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +>__awaiter : Symbol(__awaiter, Decl(tslib.d.ts, --, --)) +>thisArg : Symbol(thisArg, Decl(tslib.d.ts, --, --)) +>_arguments : Symbol(_arguments, Decl(tslib.d.ts, --, --)) +>P : Symbol(P, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>generator : Symbol(generator, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) + diff --git a/tests/baselines/reference/importHelpersES6.types b/tests/baselines/reference/importHelpersES6.types index d54a768ea7f..ebfd5a5a2a5 100644 --- a/tests/baselines/reference/importHelpersES6.types +++ b/tests/baselines/reference/importHelpersES6.types @@ -7,3 +7,47 @@ declare var dec: any; >A : A } + +=== tests/cases/compiler/tslib.d.ts === +export declare function __extends(d: Function, b: Function): void; +>__extends : (d: Function, b: Function) => void +>d : Function +>Function : Function +>b : Function +>Function : Function + +export declare function __assign(t: any, ...sources: any[]): any; +>__assign : (t: any, ...sources: any[]) => any +>t : any +>sources : any[] + +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +>__decorate : (decorators: Function[], target: any, key?: string | symbol, desc?: any) => any +>decorators : Function[] +>Function : Function +>target : any +>key : string | symbol +>desc : any + +export declare function __param(paramIndex: number, decorator: Function): Function; +>__param : (paramIndex: number, decorator: Function) => Function +>paramIndex : number +>decorator : Function +>Function : Function +>Function : Function + +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +>__metadata : (metadataKey: any, metadataValue: any) => Function +>metadataKey : any +>metadataValue : any +>Function : Function + +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +>__awaiter : (thisArg: any, _arguments: any, P: Function, generator: Function) => any +>thisArg : any +>_arguments : any +>P : Function +>Function : Function +>generator : Function +>Function : Function + diff --git a/tests/baselines/reference/importHelpersInIsolatedModules.errors.txt b/tests/baselines/reference/importHelpersInIsolatedModules.errors.txt index 9005078fada..7a53c1c8c99 100644 --- a/tests/baselines/reference/importHelpersInIsolatedModules.errors.txt +++ b/tests/baselines/reference/importHelpersInIsolatedModules.errors.txt @@ -25,4 +25,13 @@ tests/cases/compiler/script.ts(1,1): error TS1208: Cannot compile namespaces whe class C { method(@dec x: number) { } - } \ No newline at end of file + } + +==== tests/cases/compiler/tslib.d.ts (0 errors) ==== + export declare function __extends(d: Function, b: Function): void; + export declare function __assign(t: any, ...sources: any[]): any; + export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; + export declare function __param(paramIndex: number, decorator: Function): Function; + export declare function __metadata(metadataKey: any, metadataValue: any): Function; + export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; + \ No newline at end of file diff --git a/tests/baselines/reference/importHelpersInIsolatedModules.js b/tests/baselines/reference/importHelpersInIsolatedModules.js index f9aa4cfa1b9..a5929bc152c 100644 --- a/tests/baselines/reference/importHelpersInIsolatedModules.js +++ b/tests/baselines/reference/importHelpersInIsolatedModules.js @@ -22,7 +22,16 @@ declare var dec: any; class C { method(@dec x: number) { } -} +} + +//// [tslib.d.ts] +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; + //// [external.js] "use strict"; diff --git a/tests/baselines/reference/importHelpersInTsx.js b/tests/baselines/reference/importHelpersInTsx.js index 2d0ae56793f..29e43e191e8 100644 --- a/tests/baselines/reference/importHelpersInTsx.js +++ b/tests/baselines/reference/importHelpersInTsx.js @@ -5,16 +5,25 @@ declare var React: any; declare var o: any; export const x = -//// [internal.tsx] +//// [script.tsx] declare var React: any; declare var o: any; -const x = +const x = + +//// [tslib.d.ts] +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; + //// [external.js] "use strict"; var tslib_1 = require("tslib"); exports.x = React.createElement("span", tslib_1.__assign({}, o)); -//// [internal.js] +//// [script.js] var __assign = (this && this.__assign) || Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; diff --git a/tests/baselines/reference/importHelpersInTsx.symbols b/tests/baselines/reference/importHelpersInTsx.symbols index 16ca20e0fe4..465ce502385 100644 --- a/tests/baselines/reference/importHelpersInTsx.symbols +++ b/tests/baselines/reference/importHelpersInTsx.symbols @@ -10,15 +10,58 @@ export const x = >span : Symbol(unknown) >o : Symbol(o, Decl(external.tsx, 1, 11)) -=== tests/cases/compiler/internal.tsx === +=== tests/cases/compiler/script.tsx === declare var React: any; ->React : Symbol(React, Decl(internal.tsx, 0, 11)) +>React : Symbol(React, Decl(script.tsx, 0, 11)) declare var o: any; ->o : Symbol(o, Decl(internal.tsx, 1, 11)) +>o : Symbol(o, Decl(script.tsx, 1, 11)) const x = ->x : Symbol(x, Decl(internal.tsx, 2, 5)) +>x : Symbol(x, Decl(script.tsx, 2, 5)) >span : Symbol(unknown) ->o : Symbol(o, Decl(internal.tsx, 1, 11)) +>o : Symbol(o, Decl(script.tsx, 1, 11)) + +=== tests/cases/compiler/tslib.d.ts === +export declare function __extends(d: Function, b: Function): void; +>__extends : Symbol(__extends, Decl(tslib.d.ts, --, --)) +>d : Symbol(d, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>b : Symbol(b, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __assign(t: any, ...sources: any[]): any; +>__assign : Symbol(__assign, Decl(tslib.d.ts, --, --)) +>t : Symbol(t, Decl(tslib.d.ts, --, --)) +>sources : Symbol(sources, Decl(tslib.d.ts, --, --)) + +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +>__decorate : Symbol(__decorate, Decl(tslib.d.ts, --, --)) +>decorators : Symbol(decorators, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>target : Symbol(target, Decl(tslib.d.ts, --, --)) +>key : Symbol(key, Decl(tslib.d.ts, --, --)) +>desc : Symbol(desc, Decl(tslib.d.ts, --, --)) + +export declare function __param(paramIndex: number, decorator: Function): Function; +>__param : Symbol(__param, Decl(tslib.d.ts, --, --)) +>paramIndex : Symbol(paramIndex, Decl(tslib.d.ts, --, --)) +>decorator : Symbol(decorator, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +>__metadata : Symbol(__metadata, Decl(tslib.d.ts, --, --)) +>metadataKey : Symbol(metadataKey, Decl(tslib.d.ts, --, --)) +>metadataValue : Symbol(metadataValue, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +>__awaiter : Symbol(__awaiter, Decl(tslib.d.ts, --, --)) +>thisArg : Symbol(thisArg, Decl(tslib.d.ts, --, --)) +>_arguments : Symbol(_arguments, Decl(tslib.d.ts, --, --)) +>P : Symbol(P, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>generator : Symbol(generator, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/importHelpersInTsx.types b/tests/baselines/reference/importHelpersInTsx.types index 2e833e78c19..a6ae6e95f86 100644 --- a/tests/baselines/reference/importHelpersInTsx.types +++ b/tests/baselines/reference/importHelpersInTsx.types @@ -11,7 +11,7 @@ export const x = >span : any >o : any -=== tests/cases/compiler/internal.tsx === +=== tests/cases/compiler/script.tsx === declare var React: any; >React : any @@ -24,3 +24,46 @@ const x = >span : any >o : any +=== tests/cases/compiler/tslib.d.ts === +export declare function __extends(d: Function, b: Function): void; +>__extends : (d: Function, b: Function) => void +>d : Function +>Function : Function +>b : Function +>Function : Function + +export declare function __assign(t: any, ...sources: any[]): any; +>__assign : (t: any, ...sources: any[]) => any +>t : any +>sources : any[] + +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +>__decorate : (decorators: Function[], target: any, key?: string | symbol, desc?: any) => any +>decorators : Function[] +>Function : Function +>target : any +>key : string | symbol +>desc : any + +export declare function __param(paramIndex: number, decorator: Function): Function; +>__param : (paramIndex: number, decorator: Function) => Function +>paramIndex : number +>decorator : Function +>Function : Function +>Function : Function + +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +>__metadata : (metadataKey: any, metadataValue: any) => Function +>metadataKey : any +>metadataValue : any +>Function : Function + +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +>__awaiter : (thisArg: any, _arguments: any, P: Function, generator: Function) => any +>thisArg : any +>_arguments : any +>P : Function +>Function : Function +>generator : Function +>Function : Function + diff --git a/tests/baselines/reference/importHelpersNoHelpers.errors.txt b/tests/baselines/reference/importHelpersNoHelpers.errors.txt new file mode 100644 index 00000000000..ebb25dbd7c9 --- /dev/null +++ b/tests/baselines/reference/importHelpersNoHelpers.errors.txt @@ -0,0 +1,36 @@ +error TS2305: Module 'tslib' has no exported member '__decorate'. +error TS2305: Module 'tslib' has no exported member '__extends'. +error TS2305: Module 'tslib' has no exported member '__metadata'. +error TS2305: Module 'tslib' has no exported member '__param'. + + +!!! error TS2305: Module 'tslib' has no exported member '__decorate'. +!!! error TS2305: Module 'tslib' has no exported member '__extends'. +!!! error TS2305: Module 'tslib' has no exported member '__metadata'. +!!! error TS2305: Module 'tslib' has no exported member '__param'. +==== tests/cases/compiler/external.ts (0 errors) ==== + export class A { } + export class B extends A { } + + declare var dec: any; + + @dec + class C { + method(@dec x: number) { + } + } + +==== tests/cases/compiler/script.ts (0 errors) ==== + class A { } + class B extends A { } + + declare var dec: any; + + @dec + class C { + method(@dec x: number) { + } + } + +==== tests/cases/compiler/tslib.d.ts (0 errors) ==== + export {} \ No newline at end of file diff --git a/tests/baselines/reference/importHelpersNoHelpers.js b/tests/baselines/reference/importHelpersNoHelpers.js new file mode 100644 index 00000000000..8c5afc99ece --- /dev/null +++ b/tests/baselines/reference/importHelpersNoHelpers.js @@ -0,0 +1,110 @@ +//// [tests/cases/compiler/importHelpersNoHelpers.ts] //// + +//// [external.ts] +export class A { } +export class B extends A { } + +declare var dec: any; + +@dec +class C { + method(@dec x: number) { + } +} + +//// [script.ts] +class A { } +class B extends A { } + +declare var dec: any; + +@dec +class C { + method(@dec x: number) { + } +} + +//// [tslib.d.ts] +export {} + +//// [external.js] +"use strict"; +var tslib_1 = require("tslib"); +var A = (function () { + function A() { + } + return A; +}()); +exports.A = A; +var B = (function (_super) { + tslib_1.__extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +}(A)); +exports.B = B; +var C = (function () { + function C() { + } + C.prototype.method = function (x) { + }; + return C; +}()); +tslib_1.__decorate([ + tslib_1.__param(0, dec), + tslib_1.__metadata("design:type", Function), + tslib_1.__metadata("design:paramtypes", [Number]), + tslib_1.__metadata("design:returntype", void 0) +], C.prototype, "method", null); +C = tslib_1.__decorate([ + dec, + tslib_1.__metadata("design:paramtypes", []) +], C); +//// [script.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +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; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var A = (function () { + function A() { + } + return A; +}()); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +}(A)); +var C = (function () { + function C() { + } + C.prototype.method = function (x) { + }; + return C; +}()); +__decorate([ + __param(0, dec), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Number]), + __metadata("design:returntype", void 0) +], C.prototype, "method", null); +C = __decorate([ + dec, + __metadata("design:paramtypes", []) +], C); diff --git a/tests/baselines/reference/importHelpersNoModule.errors.txt b/tests/baselines/reference/importHelpersNoModule.errors.txt new file mode 100644 index 00000000000..d59fd0537ca --- /dev/null +++ b/tests/baselines/reference/importHelpersNoModule.errors.txt @@ -0,0 +1,28 @@ +error TS2307: Cannot find module 'tslib'. + + +!!! error TS2307: Cannot find module 'tslib'. +==== tests/cases/compiler/external.ts (0 errors) ==== + export class A { } + export class B extends A { } + + declare var dec: any; + + @dec + class C { + method(@dec x: number) { + } + } + +==== tests/cases/compiler/script.ts (0 errors) ==== + class A { } + class B extends A { } + + declare var dec: any; + + @dec + class C { + method(@dec x: number) { + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/importHelpersNoModule.js b/tests/baselines/reference/importHelpersNoModule.js new file mode 100644 index 00000000000..36bc0c5f76b --- /dev/null +++ b/tests/baselines/reference/importHelpersNoModule.js @@ -0,0 +1,108 @@ +//// [tests/cases/compiler/importHelpersNoModule.ts] //// + +//// [external.ts] +export class A { } +export class B extends A { } + +declare var dec: any; + +@dec +class C { + method(@dec x: number) { + } +} + +//// [script.ts] +class A { } +class B extends A { } + +declare var dec: any; + +@dec +class C { + method(@dec x: number) { + } +} + + +//// [external.js] +"use strict"; +var tslib_1 = require("tslib"); +var A = (function () { + function A() { + } + return A; +}()); +exports.A = A; +var B = (function (_super) { + tslib_1.__extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +}(A)); +exports.B = B; +var C = (function () { + function C() { + } + C.prototype.method = function (x) { + }; + return C; +}()); +tslib_1.__decorate([ + tslib_1.__param(0, dec), + tslib_1.__metadata("design:type", Function), + tslib_1.__metadata("design:paramtypes", [Number]), + tslib_1.__metadata("design:returntype", void 0) +], C.prototype, "method", null); +C = tslib_1.__decorate([ + dec, + tslib_1.__metadata("design:paramtypes", []) +], C); +//// [script.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +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; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var A = (function () { + function A() { + } + return A; +}()); +var B = (function (_super) { + __extends(B, _super); + function B() { + _super.apply(this, arguments); + } + return B; +}(A)); +var C = (function () { + function C() { + } + C.prototype.method = function (x) { + }; + return C; +}()); +__decorate([ + __param(0, dec), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Number]), + __metadata("design:returntype", void 0) +], C.prototype, "method", null); +C = __decorate([ + dec, + __metadata("design:paramtypes", []) +], C); diff --git a/tests/baselines/reference/importHelpersOutFile.js b/tests/baselines/reference/importHelpersOutFile.js index 6071c78416e..cb50330c20c 100644 --- a/tests/baselines/reference/importHelpersOutFile.js +++ b/tests/baselines/reference/importHelpersOutFile.js @@ -1,14 +1,24 @@ //// [tests/cases/compiler/importHelpersOutFile.ts] //// //// [a.ts] -export class A { } +export class A { } + //// [b.ts] import { A } from "./a"; -export class B extends A { } +export class B extends A { } + //// [c.ts] import { A } from "./a"; export class C extends A { } +//// [tslib.d.ts] +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; + //// [out.js] define("a", ["require", "exports"], function (require, exports) { diff --git a/tests/baselines/reference/importHelpersOutFile.symbols b/tests/baselines/reference/importHelpersOutFile.symbols index cd65e3dcd69..086f3f9995e 100644 --- a/tests/baselines/reference/importHelpersOutFile.symbols +++ b/tests/baselines/reference/importHelpersOutFile.symbols @@ -18,3 +18,46 @@ export class C extends A { } >C : Symbol(C, Decl(c.ts, 0, 24)) >A : Symbol(A, Decl(c.ts, 0, 8)) +=== tests/cases/compiler/tslib.d.ts === +export declare function __extends(d: Function, b: Function): void; +>__extends : Symbol(__extends, Decl(tslib.d.ts, --, --)) +>d : Symbol(d, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>b : Symbol(b, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __assign(t: any, ...sources: any[]): any; +>__assign : Symbol(__assign, Decl(tslib.d.ts, --, --)) +>t : Symbol(t, Decl(tslib.d.ts, --, --)) +>sources : Symbol(sources, Decl(tslib.d.ts, --, --)) + +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +>__decorate : Symbol(__decorate, Decl(tslib.d.ts, --, --)) +>decorators : Symbol(decorators, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>target : Symbol(target, Decl(tslib.d.ts, --, --)) +>key : Symbol(key, Decl(tslib.d.ts, --, --)) +>desc : Symbol(desc, Decl(tslib.d.ts, --, --)) + +export declare function __param(paramIndex: number, decorator: Function): Function; +>__param : Symbol(__param, Decl(tslib.d.ts, --, --)) +>paramIndex : Symbol(paramIndex, Decl(tslib.d.ts, --, --)) +>decorator : Symbol(decorator, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +>__metadata : Symbol(__metadata, Decl(tslib.d.ts, --, --)) +>metadataKey : Symbol(metadataKey, Decl(tslib.d.ts, --, --)) +>metadataValue : Symbol(metadataValue, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +>__awaiter : Symbol(__awaiter, Decl(tslib.d.ts, --, --)) +>thisArg : Symbol(thisArg, Decl(tslib.d.ts, --, --)) +>_arguments : Symbol(_arguments, Decl(tslib.d.ts, --, --)) +>P : Symbol(P, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>generator : Symbol(generator, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/importHelpersOutFile.types b/tests/baselines/reference/importHelpersOutFile.types index 94726de43e5..96adc466d65 100644 --- a/tests/baselines/reference/importHelpersOutFile.types +++ b/tests/baselines/reference/importHelpersOutFile.types @@ -18,3 +18,46 @@ export class C extends A { } >C : C >A : A +=== tests/cases/compiler/tslib.d.ts === +export declare function __extends(d: Function, b: Function): void; +>__extends : (d: Function, b: Function) => void +>d : Function +>Function : Function +>b : Function +>Function : Function + +export declare function __assign(t: any, ...sources: any[]): any; +>__assign : (t: any, ...sources: any[]) => any +>t : any +>sources : any[] + +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +>__decorate : (decorators: Function[], target: any, key?: string | symbol, desc?: any) => any +>decorators : Function[] +>Function : Function +>target : any +>key : string | symbol +>desc : any + +export declare function __param(paramIndex: number, decorator: Function): Function; +>__param : (paramIndex: number, decorator: Function) => Function +>paramIndex : number +>decorator : Function +>Function : Function +>Function : Function + +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +>__metadata : (metadataKey: any, metadataValue: any) => Function +>metadataKey : any +>metadataValue : any +>Function : Function + +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +>__awaiter : (thisArg: any, _arguments: any, P: Function, generator: Function) => any +>thisArg : any +>_arguments : any +>P : Function +>Function : Function +>generator : Function +>Function : Function + diff --git a/tests/baselines/reference/importHelpersSystem.js b/tests/baselines/reference/importHelpersSystem.js index 664edef5248..3c1ee19ec48 100644 --- a/tests/baselines/reference/importHelpersSystem.js +++ b/tests/baselines/reference/importHelpersSystem.js @@ -1,11 +1,20 @@ //// [tests/cases/compiler/importHelpersSystem.ts] //// //// [a.ts] -export class A { } +export class A { } + //// [b.ts] import { A } from "./a"; export class B extends A { } +//// [tslib.d.ts] +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; + //// [a.js] System.register([], function (exports_1, context_1) { diff --git a/tests/baselines/reference/importHelpersSystem.symbols b/tests/baselines/reference/importHelpersSystem.symbols index d4155c4bf52..47528a8bba6 100644 --- a/tests/baselines/reference/importHelpersSystem.symbols +++ b/tests/baselines/reference/importHelpersSystem.symbols @@ -10,3 +10,46 @@ export class B extends A { } >B : Symbol(B, Decl(b.ts, 0, 24)) >A : Symbol(A, Decl(b.ts, 0, 8)) +=== tests/cases/compiler/tslib.d.ts === +export declare function __extends(d: Function, b: Function): void; +>__extends : Symbol(__extends, Decl(tslib.d.ts, --, --)) +>d : Symbol(d, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>b : Symbol(b, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __assign(t: any, ...sources: any[]): any; +>__assign : Symbol(__assign, Decl(tslib.d.ts, --, --)) +>t : Symbol(t, Decl(tslib.d.ts, --, --)) +>sources : Symbol(sources, Decl(tslib.d.ts, --, --)) + +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +>__decorate : Symbol(__decorate, Decl(tslib.d.ts, --, --)) +>decorators : Symbol(decorators, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>target : Symbol(target, Decl(tslib.d.ts, --, --)) +>key : Symbol(key, Decl(tslib.d.ts, --, --)) +>desc : Symbol(desc, Decl(tslib.d.ts, --, --)) + +export declare function __param(paramIndex: number, decorator: Function): Function; +>__param : Symbol(__param, Decl(tslib.d.ts, --, --)) +>paramIndex : Symbol(paramIndex, Decl(tslib.d.ts, --, --)) +>decorator : Symbol(decorator, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +>__metadata : Symbol(__metadata, Decl(tslib.d.ts, --, --)) +>metadataKey : Symbol(metadataKey, Decl(tslib.d.ts, --, --)) +>metadataValue : Symbol(metadataValue, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +>__awaiter : Symbol(__awaiter, Decl(tslib.d.ts, --, --)) +>thisArg : Symbol(thisArg, Decl(tslib.d.ts, --, --)) +>_arguments : Symbol(_arguments, Decl(tslib.d.ts, --, --)) +>P : Symbol(P, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>generator : Symbol(generator, Decl(tslib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/importHelpersSystem.types b/tests/baselines/reference/importHelpersSystem.types index 7f313d87cd6..9ff756ffaab 100644 --- a/tests/baselines/reference/importHelpersSystem.types +++ b/tests/baselines/reference/importHelpersSystem.types @@ -10,3 +10,46 @@ export class B extends A { } >B : B >A : A +=== tests/cases/compiler/tslib.d.ts === +export declare function __extends(d: Function, b: Function): void; +>__extends : (d: Function, b: Function) => void +>d : Function +>Function : Function +>b : Function +>Function : Function + +export declare function __assign(t: any, ...sources: any[]): any; +>__assign : (t: any, ...sources: any[]) => any +>t : any +>sources : any[] + +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +>__decorate : (decorators: Function[], target: any, key?: string | symbol, desc?: any) => any +>decorators : Function[] +>Function : Function +>target : any +>key : string | symbol +>desc : any + +export declare function __param(paramIndex: number, decorator: Function): Function; +>__param : (paramIndex: number, decorator: Function) => Function +>paramIndex : number +>decorator : Function +>Function : Function +>Function : Function + +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +>__metadata : (metadataKey: any, metadataValue: any) => Function +>metadataKey : any +>metadataValue : any +>Function : Function + +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +>__awaiter : (thisArg: any, _arguments: any, P: Function, generator: Function) => any +>thisArg : any +>_arguments : any +>P : Function +>Function : Function +>generator : Function +>Function : Function + diff --git a/tests/cases/compiler/importHelpers.ts b/tests/cases/compiler/importHelpers.ts index 7a578fa70f3..2e15eb6352b 100644 --- a/tests/cases/compiler/importHelpers.ts +++ b/tests/cases/compiler/importHelpers.ts @@ -1,6 +1,7 @@ // @importHelpers: true // @target: es5 // @module: commonjs +// @moduleResolution: classic // @experimentalDecorators: true // @emitDecoratorMetadata: true // @filename: external.ts @@ -25,4 +26,12 @@ declare var dec: any; class C { method(@dec x: number) { } -} \ No newline at end of file +} + +// @filename: tslib.d.ts +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; diff --git a/tests/cases/compiler/importHelpersAmd.ts b/tests/cases/compiler/importHelpersAmd.ts index 6d21a380178..bef63328d52 100644 --- a/tests/cases/compiler/importHelpersAmd.ts +++ b/tests/cases/compiler/importHelpersAmd.ts @@ -3,6 +3,15 @@ // @module: amd // @filename: a.ts export class A { } + // @filename: b.ts import { A } from "./a"; export class B extends A { } + +// @filename: tslib.d.ts +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; diff --git a/tests/cases/compiler/importHelpersES6.ts b/tests/cases/compiler/importHelpersES6.ts index 7dfa70e2325..9be680a88d6 100644 --- a/tests/cases/compiler/importHelpersES6.ts +++ b/tests/cases/compiler/importHelpersES6.ts @@ -5,4 +5,12 @@ declare var dec: any; @dec export class A { -} \ No newline at end of file +} + +// @filename: tslib.d.ts +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; diff --git a/tests/cases/compiler/importHelpersInIsolatedModules.ts b/tests/cases/compiler/importHelpersInIsolatedModules.ts index c55ba6e52e4..4c1dfd06ec0 100644 --- a/tests/cases/compiler/importHelpersInIsolatedModules.ts +++ b/tests/cases/compiler/importHelpersInIsolatedModules.ts @@ -2,6 +2,7 @@ // @isolatedModules: true // @target: es5 // @module: commonjs +// @moduleResolution: classic // @experimentalDecorators: true // @emitDecoratorMetadata: true // @filename: external.ts @@ -26,4 +27,12 @@ declare var dec: any; class C { method(@dec x: number) { } -} \ No newline at end of file +} + +// @filename: tslib.d.ts +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; diff --git a/tests/cases/compiler/importHelpersInTsx.tsx b/tests/cases/compiler/importHelpersInTsx.tsx index b1ab98ec5db..32e0e5bf3a0 100644 --- a/tests/cases/compiler/importHelpersInTsx.tsx +++ b/tests/cases/compiler/importHelpersInTsx.tsx @@ -1,6 +1,7 @@ // @importHelpers: true // @target: es5 // @module: commonjs +// @moduleResolution: classic // @jsx: react // @experimentalDecorators: true // @emitDecoratorMetadata: true @@ -9,7 +10,15 @@ declare var React: any; declare var o: any; export const x = -// @filename: internal.tsx +// @filename: script.tsx declare var React: any; declare var o: any; -const x = \ No newline at end of file +const x = + +// @filename: tslib.d.ts +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; diff --git a/tests/cases/compiler/importHelpersNoHelpers.ts b/tests/cases/compiler/importHelpersNoHelpers.ts new file mode 100644 index 00000000000..82428552548 --- /dev/null +++ b/tests/cases/compiler/importHelpersNoHelpers.ts @@ -0,0 +1,32 @@ +// @importHelpers: true +// @target: es5 +// @module: commonjs +// @moduleResolution: classic +// @experimentalDecorators: true +// @emitDecoratorMetadata: true +// @filename: external.ts +export class A { } +export class B extends A { } + +declare var dec: any; + +@dec +class C { + method(@dec x: number) { + } +} + +// @filename: script.ts +class A { } +class B extends A { } + +declare var dec: any; + +@dec +class C { + method(@dec x: number) { + } +} + +// @filename: tslib.d.ts +export {} \ No newline at end of file diff --git a/tests/cases/compiler/importHelpersNoModule.ts b/tests/cases/compiler/importHelpersNoModule.ts new file mode 100644 index 00000000000..e824f2afb48 --- /dev/null +++ b/tests/cases/compiler/importHelpersNoModule.ts @@ -0,0 +1,29 @@ +// @importHelpers: true +// @target: es5 +// @module: commonjs +// @moduleResolution: classic +// @experimentalDecorators: true +// @emitDecoratorMetadata: true +// @filename: external.ts +export class A { } +export class B extends A { } + +declare var dec: any; + +@dec +class C { + method(@dec x: number) { + } +} + +// @filename: script.ts +class A { } +class B extends A { } + +declare var dec: any; + +@dec +class C { + method(@dec x: number) { + } +} diff --git a/tests/cases/compiler/importHelpersOutFile.ts b/tests/cases/compiler/importHelpersOutFile.ts index 471f363c65d..69e1e692617 100644 --- a/tests/cases/compiler/importHelpersOutFile.ts +++ b/tests/cases/compiler/importHelpersOutFile.ts @@ -4,9 +4,19 @@ // @outfile: out.js // @filename: a.ts export class A { } + // @filename: b.ts import { A } from "./a"; export class B extends A { } + // @filename: c.ts import { A } from "./a"; export class C extends A { } + +// @filename: tslib.d.ts +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; diff --git a/tests/cases/compiler/importHelpersSystem.ts b/tests/cases/compiler/importHelpersSystem.ts index 1b81e748ff0..5b6081f17f3 100644 --- a/tests/cases/compiler/importHelpersSystem.ts +++ b/tests/cases/compiler/importHelpersSystem.ts @@ -3,6 +3,15 @@ // @module: system // @filename: a.ts export class A { } + // @filename: b.ts import { A } from "./a"; export class B extends A { } + +// @filename: tslib.d.ts +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any;