forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick PR microsoft#54317 into release-5.1
Component commits: 18b8b63 Resolve re-exports when looking for tslib helpers 2d702aa Accept baselines
- Loading branch information
1 parent
7e48587
commit 818ff18
Showing
5 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//// [tests/cases/compiler/tslibReExportHelpers.ts] //// | ||
|
||
//// [index.d.ts] | ||
export declare function __decorate(...args: any[]): any; | ||
|
||
//// [index.d.mts] | ||
export * from "./index.js"; | ||
|
||
//// [package.json] | ||
{ | ||
"name": "tslib", | ||
"version": "1.0.0", | ||
"types": "index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": { | ||
"import": "./index.d.mts", | ||
"default": "./index.d.ts" | ||
} | ||
} | ||
} | ||
} | ||
|
||
//// [index.mts] | ||
declare var decorator: any; | ||
@decorator | ||
export class Foo {} | ||
|
||
|
||
//// [index.mjs] | ||
import { __decorate } from "tslib"; | ||
export var Foo = /** @class */ (function () { | ||
function Foo() { | ||
} | ||
Foo = __decorate([ | ||
decorator | ||
], Foo); | ||
return Foo; | ||
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
=== /node_modules/tslib/index.d.ts === | ||
export declare function __decorate(...args: any[]): any; | ||
>__decorate : Symbol(__decorate, Decl(index.d.ts, 0, 0)) | ||
>args : Symbol(args, Decl(index.d.ts, 0, 35)) | ||
|
||
=== /node_modules/tslib/index.d.mts === | ||
|
||
export * from "./index.js"; | ||
|
||
=== /index.mts === | ||
declare var decorator: any; | ||
>decorator : Symbol(decorator, Decl(index.mts, 0, 11)) | ||
|
||
@decorator | ||
>decorator : Symbol(decorator, Decl(index.mts, 0, 11)) | ||
|
||
export class Foo {} | ||
>Foo : Symbol(Foo, Decl(index.mts, 0, 27)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
=== /node_modules/tslib/index.d.ts === | ||
export declare function __decorate(...args: any[]): any; | ||
>__decorate : (...args: any[]) => any | ||
>args : any[] | ||
|
||
=== /node_modules/tslib/index.d.mts === | ||
|
||
export * from "./index.js"; | ||
|
||
=== /index.mts === | ||
declare var decorator: any; | ||
>decorator : any | ||
|
||
@decorator | ||
>decorator : any | ||
|
||
export class Foo {} | ||
>Foo : Foo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// @module: nodenext | ||
// @experimentalDecorators: true | ||
// @importHelpers: true | ||
|
||
// @Filename: /node_modules/tslib/index.d.ts | ||
export declare function __decorate(...args: any[]): any; | ||
|
||
// @Filename: /node_modules/tslib/index.d.mts | ||
export * from "./index.js"; | ||
|
||
// @Filename: /node_modules/tslib/package.json | ||
{ | ||
"name": "tslib", | ||
"version": "1.0.0", | ||
"types": "index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": { | ||
"import": "./index.d.mts", | ||
"default": "./index.d.ts" | ||
} | ||
} | ||
} | ||
} | ||
|
||
// @Filename: /index.mts | ||
declare var decorator: any; | ||
@decorator | ||
export class Foo {} |