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.
34 lines
768 B
TypeScript
34 lines
768 B
TypeScript
type K = (arguments: any[]) => void;
|
|
type K2 = (...arguments: any[]) => void;
|
|
|
|
interface Foo {
|
|
bar(arguments: any[]): void;
|
|
bar2(...arguments: any[]): void;
|
|
}
|
|
|
|
declare function arguments(): void;
|
|
declare function eval(): void;
|
|
declare function f(eval: number, arguments: number): number;
|
|
declare function f2(...eval: number[]): number;
|
|
declare function f3(...arguments: number[]): number;
|
|
|
|
declare class C {
|
|
constructor(arguments: number);
|
|
method(eval: number, ...arguments: number[]): void;
|
|
}
|
|
|
|
declare namespace foo {
|
|
type arguments = {};
|
|
type eval = {};
|
|
}
|
|
|
|
declare namespace foo2 {
|
|
interface arguments {}
|
|
interface eval {}
|
|
}
|
|
|
|
declare global {
|
|
function arguments(...arguments: any[]): typeof arguments;
|
|
function eval(...eval: any[]): typeof eval;
|
|
}
|