Files
oxc-project__oxc/tasks/coverage/misc/pass/arguments-eval-ambient.d.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

8 lines
322 B
TypeScript

export {};
declare var arguments: unknown;
declare const eval: unknown;
declare function objectRest({ ...arguments }: object): void;
declare function arrayRest([...eval]: unknown[]): void;
declare function objectBinding({ arguments }: { arguments: unknown }): void;
declare function arrayBinding([eval]: [unknown]): void;