Skip to content

Commit

Permalink
fix(isolated-declarations): missing empty export when has an export d…
Browse files Browse the repository at this point in the history
…eclare (#5925)
  • Loading branch information
Dunqing committed Sep 20, 2024
1 parent b80a9ee commit 756a571
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/oxc_isolated_declarations/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ impl<'a> IsolatedDeclarations<'a> {
transformed_spans.insert(decl.span);
if let Some(new_decl) = self.transform_export_named_declaration(decl) {
*decl = self.ast.alloc(new_decl);
} else {
} else if decl.declaration.is_none() {
need_empty_export_marker = false;
}
self.scope.visit_export_named_declaration(decl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ type A = string;
export function a(): A {
return ""
}

export declare const ShallowReactiveMarker: unique symbol

export type ShallowReactive<T> = T & { [ShallowReactiveMarker]?: true }
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ input_file: crates/oxc_isolated_declarations/tests/fixtures/empty-export.ts

type A = string;
export declare function a(): A;
export declare const ShallowReactiveMarker: unique symbol;
export type ShallowReactive<T> = T & { [ShallowReactiveMarker]?: true };
export {};

0 comments on commit 756a571

Please sign in to comment.