Files
oxc-project__oxc/tasks/coverage/misc/fail/arguments-eval.ts
camc314 47ddedf011 fix(semantic): allow arguments in ambient declarations (#24758)
## Summary

- allow `eval` and `arguments` as direct bindings in ambient declarations
- continue reporting strict-mode errors for destructured ambient bindings
- add focused coverage for declared functions, classes, object patterns, and array patterns

## Why

The semantic checker previously identified allowed bindings by walking to a `TSDeclareFunction`. That missed other ambient declarations, including declared class constructors and methods, and produced diagnostics for TypeScript cases that require no runtime code generation.

The check now uses the existing ambient-context state and rejects only destructuring binding shapes.
2026-07-21 12:43:21 +00:00

19 lines
548 B
TypeScript

function arguments() {}
function eval() {}
function foo({ arguments }) {}
function foo2([arguments]) {}
function foo3({ eval }) {}
function foo4([eval]) {}
declare function foo5({ arguments }: { arguments: number }): void;
declare function foo6([eval]: [number]): void;
declare function foo7([arguments = 0]: [number?]): void;
declare function foo8({ ...arguments }: object): void;
declare function foo9([...eval]: unknown[]): void;
declare class C {
method({ eval }: { eval: number }): void;
constructor([arguments]: [number]);
}
export {};