-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/typescript): Analyze import chain (#9369)
- Closes #9368 --------- Co-authored-by: Donny/강동윤 <kdy1997.dev@gmail.com>
- Loading branch information
1 parent
4190657
commit 4f9116f
Showing
11 changed files
with
70 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
swc_ecma_transforms_typescript: patch | ||
--- | ||
|
||
fix(es/typescript): Analyze import chain |
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
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
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
var C; | ||
// no code gen expected | ||
(function(C) { | ||
var a = A; | ||
var m; | ||
var p; | ||
var p = { | ||
|
2 changes: 1 addition & 1 deletion
2
crates/swc/tests/tsc-references/importStatementsInterfaces.2.minified.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
//// [importStatementsInterfaces.ts] | ||
var C, D, E; | ||
C || (C = {}), A, D || (D = {}), (E || (E = {})).xDist = function(x) { | ||
C || (C = {}), D || (D = {}), (E || (E = {})).xDist = function(x) { | ||
return 0 - x.x; | ||
}; |
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
1 change: 0 additions & 1 deletion
1
...ransforms_typescript/tests/__swc_snapshots__/tests/strip.rs/deno_12395_import_equals_2.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 |
---|---|---|
@@ -1,2 +1 @@ | ||
import * as mongo from 'https://deno.land/x/mongo@v0.27.0/mod.ts'; | ||
const mongoClient = {}; |
16 changes: 16 additions & 0 deletions
16
crates/swc_ecma_transforms_typescript/tests/fixture/issue-9368/input.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,16 @@ | ||
import { Schemas } from './types.d'; | ||
import AddressResource = Schemas.AddressResource; | ||
|
||
// type usage | ||
const x: AddressResource = {}; | ||
|
||
|
||
import { foo, bar } from "mod"; | ||
|
||
// value usage | ||
import y = foo.y; | ||
|
||
// type usage | ||
import z = bar.z; | ||
|
||
console.log(y as z); |
6 changes: 6 additions & 0 deletions
6
crates/swc_ecma_transforms_typescript/tests/fixture/issue-9368/output.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,6 @@ | ||
// type usage | ||
const x = {}; | ||
import { foo } from "mod"; | ||
// value usage | ||
const y = foo.y; | ||
console.log(y); |