Skip to content

Commit

Permalink
fix(isolated-declarations): accidentally collected references of orig…
Browse files Browse the repository at this point in the history
…inal ast (#6102)
  • Loading branch information
Dunqing committed Sep 27, 2024
1 parent 60d02a6 commit a8338dd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crates/oxc_isolated_declarations/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const defaultDelimitersClose = new Uint8Array([125, 125])

export default class Tokenizer {
public delimiterClose: Uint8Array = defaultDelimitersClose
}

Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit a8338dd

Please sign in to comment.