Skip to content

Commit

Permalink
Disallow clearing timers without no argument at all (#1330)
Browse files Browse the repository at this point in the history
Co-authored-by: saschanaz <[email protected]>
  • Loading branch information
Andarist and saschanaz committed May 15, 2022
1 parent cf49d9e commit 9e13665
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 16 deletions.
8 changes: 4 additions & 4 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16670,8 +16670,8 @@ interface WindowOrWorkerGlobalScope {
readonly performance: Performance;
atob(data: string): string;
btoa(data: string): string;
clearInterval(id?: number): void;
clearTimeout(id?: number): void;
clearInterval(id: number | undefined): void;
clearTimeout(id: number | undefined): void;
createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
Expand Down Expand Up @@ -17978,8 +17978,8 @@ declare var origin: string;
declare var performance: Performance;
declare function atob(data: string): string;
declare function btoa(data: string): string;
declare function clearInterval(id?: number): void;
declare function clearTimeout(id?: number): void;
declare function clearInterval(id: number | undefined): void;
declare function clearTimeout(id: number | undefined): void;
declare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
Expand Down
8 changes: 4 additions & 4 deletions baselines/serviceworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5116,8 +5116,8 @@ interface WindowOrWorkerGlobalScope {
readonly performance: Performance;
atob(data: string): string;
btoa(data: string): string;
clearInterval(id?: number): void;
clearTimeout(id?: number): void;
clearInterval(id: number | undefined): void;
clearTimeout(id: number | undefined): void;
createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
Expand Down Expand Up @@ -5488,8 +5488,8 @@ declare var origin: string;
declare var performance: Performance;
declare function atob(data: string): string;
declare function btoa(data: string): string;
declare function clearInterval(id?: number): void;
declare function clearTimeout(id?: number): void;
declare function clearInterval(id: number | undefined): void;
declare function clearTimeout(id: number | undefined): void;
declare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
Expand Down
8 changes: 4 additions & 4 deletions baselines/sharedworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4969,8 +4969,8 @@ interface WindowOrWorkerGlobalScope {
readonly performance: Performance;
atob(data: string): string;
btoa(data: string): string;
clearInterval(id?: number): void;
clearTimeout(id?: number): void;
clearInterval(id: number | undefined): void;
clearTimeout(id: number | undefined): void;
createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
Expand Down Expand Up @@ -5502,8 +5502,8 @@ declare var origin: string;
declare var performance: Performance;
declare function atob(data: string): string;
declare function btoa(data: string): string;
declare function clearInterval(id?: number): void;
declare function clearTimeout(id?: number): void;
declare function clearInterval(id: number | undefined): void;
declare function clearTimeout(id: number | undefined): void;
declare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
Expand Down
8 changes: 4 additions & 4 deletions baselines/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5250,8 +5250,8 @@ interface WindowOrWorkerGlobalScope {
readonly performance: Performance;
atob(data: string): string;
btoa(data: string): string;
clearInterval(id?: number): void;
clearTimeout(id?: number): void;
clearInterval(id: number | undefined): void;
clearTimeout(id: number | undefined): void;
createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
Expand Down Expand Up @@ -5791,8 +5791,8 @@ declare var origin: string;
declare var performance: Performance;
declare function atob(data: string): string;
declare function btoa(data: string): string;
declare function clearInterval(id?: number): void;
declare function clearTimeout(id?: number): void;
declare function clearInterval(id: number | undefined): void;
declare function clearTimeout(id: number | undefined): void;
declare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
Expand Down
32 changes: 32 additions & 0 deletions inputfiles/overridingTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,38 @@
}
}
}
},
"WindowOrWorkerGlobalScope": {
"methods": {
"method": {
"clearInterval": {
"signature": {
"0": {
"param": [
{
"name": "id",
"optional": false,
"additionalTypes": ["undefined"]
}
]
}
}
},
"clearTimeout": {
"signature": {
"0": {
"param": [
{
"name": "id",
"optional": false,
"additionalTypes": ["undefined"]
}
]
}
}
}
}
}
}
}
},
Expand Down

0 comments on commit 9e13665

Please sign in to comment.