mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
fix(isolated-declarations): accidentally collected references of original ast (#6102)
This commit is contained in:
parent
60d02a61f9
commit
a8338ddfe3
3 changed files with 18 additions and 4 deletions
|
|
@ -225,9 +225,6 @@ impl<'a> IsolatedDeclarations<'a> {
|
|||
match_module_declaration!(Statement) => {
|
||||
match stmt.to_module_declaration() {
|
||||
ModuleDeclaration::ExportDefaultDeclaration(decl) => {
|
||||
if self.has_internal_annotation(decl.span) {
|
||||
continue;
|
||||
}
|
||||
transformed_spans.insert(decl.span);
|
||||
if let Some((var_decl, new_decl)) =
|
||||
self.transform_export_default_declaration(decl)
|
||||
|
|
@ -246,10 +243,11 @@ impl<'a> IsolatedDeclarations<'a> {
|
|||
self.ast.alloc(new_decl),
|
||||
)),
|
||||
);
|
||||
} else {
|
||||
self.scope.visit_export_default_declaration(decl);
|
||||
}
|
||||
|
||||
need_empty_export_marker = false;
|
||||
self.scope.visit_export_default_declaration(decl);
|
||||
}
|
||||
|
||||
ModuleDeclaration::ExportNamedDeclaration(decl) => {
|
||||
|
|
|
|||
6
crates/oxc_isolated_declarations/tests/fixtures/export-default.ts
vendored
Normal file
6
crates/oxc_isolated_declarations/tests/fixtures/export-default.ts
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
const defaultDelimitersClose = new Uint8Array([125, 125])
|
||||
|
||||
export default class Tokenizer {
|
||||
public delimiterClose: Uint8Array = defaultDelimitersClose
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
source: crates/oxc_isolated_declarations/tests/mod.rs
|
||||
input_file: crates/oxc_isolated_declarations/tests/fixtures/export-default.ts
|
||||
---
|
||||
```
|
||||
==================== .D.TS ====================
|
||||
|
||||
export default class Tokenizer {
|
||||
delimiterClose: Uint8Array;
|
||||
}
|
||||
Loading…
Reference in a new issue