Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/oxc_isolated_declarations/src/declaration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ impl<'a> IsolatedDeclarations<'a> {
// Follows https://github.com/microsoft/TypeScript/pull/54134
let kind = TSModuleDeclarationKind::Namespace;
match body {
TSModuleDeclarationBody::TSModuleDeclaration(decl) => {
let inner = self.transform_ts_module_declaration(decl);
TSModuleDeclarationBody::TSModuleDeclaration(inner_decl) => {
let inner = self.transform_ts_module_declaration(inner_decl);
self.ast.alloc_ts_module_declaration(
decl.span,
decl.id.clone_in(self.ast.allocator),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Dotted namespace syntax should preserve all names correctly
export namespace X.Y.Z {}

// Nested dotted namespaces with content
export namespace A.B.C {
export const value = 1;
export function foo(): void {}
}

// Deeply nested
export namespace Deep.Nested.Namespace.Structure {
export interface Config {
value: string;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
source: crates/oxc_isolated_declarations/tests/mod.rs
input_file: crates/oxc_isolated_declarations/tests/fixtures/nested-namespace-dotted.ts
---
```
==================== .D.TS ====================

// Dotted namespace syntax should preserve all names correctly
export declare namespace X.Y.Z {
export {};
}
// Nested dotted namespaces with content
export declare namespace A.B.C {
const value = 1;
function foo(): void;
}
// Deeply nested
export declare namespace Deep.Nested.Namespace.Structure {
interface Config {
value: string;
}
}
Loading