mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
47ddedf011
## 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.
19 lines
548 B
TypeScript
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 {};
|