Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
markAliasReferenced should include ExportValue as well (#51219)
- Loading branch information
Showing
5 changed files
with
90 additions
and
2 deletions.
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
20 changes: 20 additions & 0 deletions
20
tests/baselines/reference/importElisionExportNonExportAndDefault.js
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,20 @@ | ||
//// [tests/cases/compiler/importElisionExportNonExportAndDefault.ts] //// | ||
|
||
//// [main.ts] | ||
import MyFunction from "./MyComponent"; | ||
|
||
MyFunction({msg: "Hello World"}); | ||
|
||
|
||
//// [MyComponent.ts] | ||
interface MyFunction { msg: string; } | ||
|
||
export const MyFunction = ({ msg }: MyFunction) => console.log(`Got message "${msg}"`); | ||
export default MyFunction; | ||
|
||
//// [MyComponent.js] | ||
export const MyFunction = ({ msg }) => console.log(`Got message "${msg}"`); | ||
export default MyFunction; | ||
//// [main.js] | ||
import MyFunction from "./MyComponent"; | ||
MyFunction({ msg: "Hello World" }); |
25 changes: 25 additions & 0 deletions
25
tests/baselines/reference/importElisionExportNonExportAndDefault.symbols
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,25 @@ | ||
=== tests/cases/compiler/main.ts === | ||
import MyFunction from "./MyComponent"; | ||
>MyFunction : Symbol(MyFunction, Decl(main.ts, 0, 6)) | ||
|
||
MyFunction({msg: "Hello World"}); | ||
>msg : Symbol(msg, Decl(main.ts, 2, 12)) | ||
|
||
|
||
=== tests/cases/compiler/MyComponent.ts === | ||
interface MyFunction { msg: string; } | ||
>MyFunction : Symbol(MyFunction, Decl(MyComponent.ts, 0, 0), Decl(MyComponent.ts, 2, 12)) | ||
>msg : Symbol(MyFunction.msg, Decl(MyComponent.ts, 0, 22)) | ||
|
||
export const MyFunction = ({ msg }: MyFunction) => console.log(`Got message "${msg}"`); | ||
>MyFunction : Symbol(MyFunction, Decl(MyComponent.ts, 2, 12)) | ||
>msg : Symbol(msg, Decl(MyComponent.ts, 2, 28)) | ||
>MyFunction : Symbol(MyFunction, Decl(MyComponent.ts, 0, 0), Decl(MyComponent.ts, 2, 12)) | ||
>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, --, --)) | ||
>msg : Symbol(msg, Decl(MyComponent.ts, 2, 28)) | ||
|
||
export default MyFunction; | ||
>MyFunction : Symbol(MyFunction, Decl(MyComponent.ts, 0, 0), Decl(MyComponent.ts, 2, 12)) | ||
|
30 changes: 30 additions & 0 deletions
30
tests/baselines/reference/importElisionExportNonExportAndDefault.types
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,30 @@ | ||
=== tests/cases/compiler/main.ts === | ||
import MyFunction from "./MyComponent"; | ||
>MyFunction : any | ||
|
||
MyFunction({msg: "Hello World"}); | ||
>MyFunction({msg: "Hello World"}) : error | ||
>MyFunction : error | ||
>{msg: "Hello World"} : { msg: string; } | ||
>msg : string | ||
>"Hello World" : "Hello World" | ||
|
||
|
||
=== tests/cases/compiler/MyComponent.ts === | ||
interface MyFunction { msg: string; } | ||
>msg : string | ||
|
||
export const MyFunction = ({ msg }: MyFunction) => console.log(`Got message "${msg}"`); | ||
>MyFunction : ({ msg }: MyFunction) => void | ||
>({ msg }: MyFunction) => console.log(`Got message "${msg}"`) : ({ msg }: MyFunction) => void | ||
>msg : string | ||
>console.log(`Got message "${msg}"`) : void | ||
>console.log : (...data: any[]) => void | ||
>console : Console | ||
>log : (...data: any[]) => void | ||
>`Got message "${msg}"` : string | ||
>msg : string | ||
|
||
export default MyFunction; | ||
>MyFunction : MyFunction | ||
|
13 changes: 13 additions & 0 deletions
13
tests/cases/compiler/importElisionExportNonExportAndDefault.ts
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,13 @@ | ||
// @target: esnext | ||
// @module: esnext | ||
// @filename: main.ts | ||
import MyFunction from "./MyComponent"; | ||
|
||
MyFunction({msg: "Hello World"}); | ||
|
||
|
||
// @filename: MyComponent.ts | ||
interface MyFunction { msg: string; } | ||
|
||
export const MyFunction = ({ msg }: MyFunction) => console.log(`Got message "${msg}"`); | ||
export default MyFunction; |