mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
b846abc2a4
## Summary - treat value declarations in ambient namespaces as implicitly exported for expando-function validation - preserve local versus exported namespace visibility to match TypeScript declaration merging - add regression coverage for accepted ambient value declarations and rejected local or type-only declarations ## TypeScript compatibility The regression fixture was checked with TypeScript 6.0.3. TypeScript and Oxc produce TS9023 only for the exported-function/local-namespace mismatch and the type-only namespace property. Closes #24975
27 lines
606 B
Plaintext
27 lines
606 B
Plaintext
---
|
|
source: crates/oxc_isolated_declarations/tests/mod.rs
|
|
input_file: crates/oxc_isolated_declarations/tests/fixtures/expando-function-ambient-variable.ts
|
|
---
|
|
```
|
|
==================== .D.TS ====================
|
|
|
|
declare const f: () => void;
|
|
declare namespace f {
|
|
let property: number;
|
|
}
|
|
|
|
|
|
==================== Errors ====================
|
|
|
|
x TS9023: Assigning properties to functions without declaring them is not
|
|
| supported with --isolatedDeclarations. Add an explicit declaration for the
|
|
| properties assigned to this function.
|
|
,-[7:1]
|
|
6 |
|
|
7 | f.property = 1;
|
|
: ^^^^^^^^^^
|
|
`----
|
|
|
|
|
|
```
|