-
-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(isolated-declarations): bindings referenced in TSModuleDeclaratio…
…n are removed incorrectly
- Loading branch information
Showing
4 changed files
with
34 additions
and
16 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
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
30 changes: 20 additions & 10 deletions
30
crates/oxc_isolated_declarations/tests/fixtures/module-declaration.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 |
---|---|---|
@@ -1,21 +1,31 @@ | ||
import 'foo'; | ||
declare module 'foo' { | ||
interface Foo {} | ||
const foo = 42; | ||
import "foo"; | ||
declare module "foo" { | ||
interface Foo {} | ||
const foo = 42; | ||
} | ||
|
||
declare global { | ||
interface Bar {} | ||
const bar = 42 ; | ||
interface Bar {} | ||
const bar = 42; | ||
} | ||
|
||
import { type X } from "./x"; | ||
type Y = 1; | ||
|
||
declare module "foo" { | ||
interface Foo { | ||
x: X; | ||
y: Y; | ||
} | ||
} | ||
|
||
// should not be emitted | ||
module baz { | ||
interface Baz {} | ||
const baz = 42; | ||
interface Baz {} | ||
const baz = 42; | ||
} | ||
|
||
declare module x { | ||
interface Qux {} | ||
const qux = 42; | ||
interface Qux {} | ||
const qux = 42; | ||
} |
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