-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤖 Pick PR #54450 (Resolve tslib re-exports before che...) into releas…
…e-5.1 (#54457) Co-authored-by: Andrew Branch <andrew@wheream.io>
- Loading branch information
1 parent
a360d9f
commit b7d523e
Showing
5 changed files
with
241 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,56 @@ | ||
//// [tests/cases/compiler/tslibReExportHelpers2.ts] //// | ||
|
||
//// [index.d.ts] | ||
export declare function __classPrivateFieldGet<T extends object, V>( | ||
receiver: T, | ||
state: { has(o: T): boolean, get(o: T): V | undefined }, | ||
kind?: "f" | ||
): V; | ||
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V>( | ||
receiver: T, | ||
state: T, | ||
kind: "f", | ||
f: { value: V } | ||
): V; | ||
|
||
//// [index.d.mts] | ||
export { __classPrivateFieldGet } 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] | ||
export class Foo { | ||
constructor() { | ||
console.log(Foo.#test()); | ||
} | ||
|
||
static #test() { | ||
return 'success'; | ||
} | ||
} | ||
|
||
|
||
//// [index.mjs] | ||
var _a, _Foo_test; | ||
import { __classPrivateFieldGet } from "tslib"; | ||
export class Foo { | ||
constructor() { | ||
console.log(__classPrivateFieldGet(Foo, _a, "m", _Foo_test).call(Foo)); | ||
} | ||
} | ||
_a = Foo, _Foo_test = function _Foo_test() { | ||
return 'success'; | ||
}; |
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,75 @@ | ||
=== /node_modules/tslib/index.d.ts === | ||
export declare function __classPrivateFieldGet<T extends object, V>( | ||
>__classPrivateFieldGet : Symbol(__classPrivateFieldGet, Decl(index.d.ts, 0, 0), Decl(index.d.ts, 4, 5)) | ||
>T : Symbol(T, Decl(index.d.ts, 0, 47)) | ||
>V : Symbol(V, Decl(index.d.ts, 0, 64)) | ||
|
||
receiver: T, | ||
>receiver : Symbol(receiver, Decl(index.d.ts, 0, 68)) | ||
>T : Symbol(T, Decl(index.d.ts, 0, 47)) | ||
|
||
state: { has(o: T): boolean, get(o: T): V | undefined }, | ||
>state : Symbol(state, Decl(index.d.ts, 1, 14)) | ||
>has : Symbol(has, Decl(index.d.ts, 2, 10)) | ||
>o : Symbol(o, Decl(index.d.ts, 2, 15)) | ||
>T : Symbol(T, Decl(index.d.ts, 0, 47)) | ||
>get : Symbol(get, Decl(index.d.ts, 2, 30)) | ||
>o : Symbol(o, Decl(index.d.ts, 2, 35)) | ||
>T : Symbol(T, Decl(index.d.ts, 0, 47)) | ||
>V : Symbol(V, Decl(index.d.ts, 0, 64)) | ||
|
||
kind?: "f" | ||
>kind : Symbol(kind, Decl(index.d.ts, 2, 58)) | ||
|
||
): V; | ||
>V : Symbol(V, Decl(index.d.ts, 0, 64)) | ||
|
||
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V>( | ||
>__classPrivateFieldGet : Symbol(__classPrivateFieldGet, Decl(index.d.ts, 0, 0), Decl(index.d.ts, 4, 5)) | ||
>T : Symbol(T, Decl(index.d.ts, 5, 47)) | ||
>args : Symbol(args, Decl(index.d.ts, 5, 62)) | ||
>V : Symbol(V, Decl(index.d.ts, 5, 89)) | ||
|
||
receiver: T, | ||
>receiver : Symbol(receiver, Decl(index.d.ts, 5, 93)) | ||
>T : Symbol(T, Decl(index.d.ts, 5, 47)) | ||
|
||
state: T, | ||
>state : Symbol(state, Decl(index.d.ts, 6, 14)) | ||
>T : Symbol(T, Decl(index.d.ts, 5, 47)) | ||
|
||
kind: "f", | ||
>kind : Symbol(kind, Decl(index.d.ts, 7, 11)) | ||
|
||
f: { value: V } | ||
>f : Symbol(f, Decl(index.d.ts, 8, 12)) | ||
>value : Symbol(value, Decl(index.d.ts, 9, 6)) | ||
>V : Symbol(V, Decl(index.d.ts, 5, 89)) | ||
|
||
): V; | ||
>V : Symbol(V, Decl(index.d.ts, 5, 89)) | ||
|
||
=== /node_modules/tslib/index.d.mts === | ||
export { __classPrivateFieldGet } from "./index.js"; | ||
>__classPrivateFieldGet : Symbol(__classPrivateFieldGet, Decl(index.d.mts, 0, 8)) | ||
|
||
=== /index.mts === | ||
export class Foo { | ||
>Foo : Symbol(Foo, Decl(index.mts, 0, 0)) | ||
|
||
constructor() { | ||
console.log(Foo.#test()); | ||
>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) | ||
>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) | ||
>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) | ||
>Foo.#test : Symbol(Foo.#test, Decl(index.mts, 3, 3)) | ||
>Foo : Symbol(Foo, Decl(index.mts, 0, 0)) | ||
} | ||
|
||
static #test() { | ||
>#test : Symbol(Foo.#test, Decl(index.mts, 3, 3)) | ||
|
||
return 'success'; | ||
} | ||
} | ||
|
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,64 @@ | ||
=== /node_modules/tslib/index.d.ts === | ||
export declare function __classPrivateFieldGet<T extends object, V>( | ||
>__classPrivateFieldGet : { <T extends object, V>(receiver: T, state: { has(o: T): boolean; get(o: T): V | undefined; }, kind?: "f"): V; <T extends new (...args: any[]) => unknown, V>(receiver: T, state: T, kind: "f", f: { value: V; }): V; } | ||
|
||
receiver: T, | ||
>receiver : T | ||
|
||
state: { has(o: T): boolean, get(o: T): V | undefined }, | ||
>state : { has(o: T): boolean; get(o: T): V | undefined; } | ||
>has : (o: T) => boolean | ||
>o : T | ||
>get : (o: T) => V | undefined | ||
>o : T | ||
|
||
kind?: "f" | ||
>kind : "f" | ||
|
||
): V; | ||
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V>( | ||
>__classPrivateFieldGet : { <T extends object, V>(receiver: T, state: { has(o: T): boolean; get(o: T): V; }, kind?: "f"): V; <T extends new (...args: any[]) => unknown, V>(receiver: T, state: T, kind: "f", f: { value: V;}): V; } | ||
>args : any[] | ||
|
||
receiver: T, | ||
>receiver : T | ||
|
||
state: T, | ||
>state : T | ||
|
||
kind: "f", | ||
>kind : "f" | ||
|
||
f: { value: V } | ||
>f : { value: V; } | ||
>value : V | ||
|
||
): V; | ||
|
||
=== /node_modules/tslib/index.d.mts === | ||
export { __classPrivateFieldGet } from "./index.js"; | ||
>__classPrivateFieldGet : { <T extends object, V>(receiver: T, state: { has(o: T): boolean; get(o: T): V; }, kind?: "f"): V; <T extends new (...args: any[]) => unknown, V>(receiver: T, state: T, kind: "f", f: { value: V; }): V; } | ||
|
||
=== /index.mts === | ||
export class Foo { | ||
>Foo : Foo | ||
|
||
constructor() { | ||
console.log(Foo.#test()); | ||
>console.log(Foo.#test()) : void | ||
>console.log : (...data: any[]) => void | ||
>console : Console | ||
>log : (...data: any[]) => void | ||
>Foo.#test() : string | ||
>Foo.#test : () => string | ||
>Foo : typeof Foo | ||
} | ||
|
||
static #test() { | ||
>#test : () => string | ||
|
||
return 'success'; | ||
>'success' : "success" | ||
} | ||
} | ||
|
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,45 @@ | ||
// @module: nodenext | ||
// @importHelpers: true | ||
// @target: es2021 | ||
|
||
// @Filename: /node_modules/tslib/index.d.ts | ||
export declare function __classPrivateFieldGet<T extends object, V>( | ||
receiver: T, | ||
state: { has(o: T): boolean, get(o: T): V | undefined }, | ||
kind?: "f" | ||
): V; | ||
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V>( | ||
receiver: T, | ||
state: T, | ||
kind: "f", | ||
f: { value: V } | ||
): V; | ||
|
||
// @Filename: /node_modules/tslib/index.d.mts | ||
export { __classPrivateFieldGet } 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 | ||
export class Foo { | ||
constructor() { | ||
console.log(Foo.#test()); | ||
} | ||
|
||
static #test() { | ||
return 'success'; | ||
} | ||
} |