Skip to content

Commit 699712c

Browse files
committed
Use globalThis for .window/.self
1 parent 10a86a2 commit 699712c

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

baselines/dom.generated.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18412,14 +18412,14 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
1841218412
readonly scrollX: number;
1841318413
readonly scrollY: number;
1841418414
readonly scrollbars: BarProp;
18415-
readonly self: Window;
18415+
readonly self: Window & typeof globalThis;
1841618416
readonly speechSynthesis: SpeechSynthesis;
1841718417
status: string;
1841818418
readonly statusbar: BarProp;
1841918419
readonly styleMedia: StyleMedia;
1842018420
readonly toolbar: BarProp;
1842118421
readonly top: Window;
18422-
readonly window: Window;
18422+
readonly window: Window & typeof globalThis;
1842318423
alert(message?: any): void;
1842418424
blur(): void;
1842518425
/** @deprecated */
@@ -19406,14 +19406,14 @@ declare var screenY: number;
1940619406
declare var scrollX: number;
1940719407
declare var scrollY: number;
1940819408
declare var scrollbars: BarProp;
19409-
declare var self: Window;
19409+
declare var self: Window & typeof globalThis;
1941019410
declare var speechSynthesis: SpeechSynthesis;
1941119411
declare var status: string;
1941219412
declare var statusbar: BarProp;
1941319413
declare var styleMedia: StyleMedia;
1941419414
declare var toolbar: BarProp;
1941519415
declare var top: Window;
19416-
declare var window: Window;
19416+
declare var window: Window & typeof globalThis;
1941719417
declare function alert(message?: any): void;
1941819418
declare function blur(): void;
1941919419
/** @deprecated */

baselines/webworker.generated.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5338,7 +5338,7 @@ interface WorkerGlobalScope extends EventTarget, WorkerUtils, WindowConsole, Win
53385338
readonly location: WorkerLocation;
53395339
onerror: ((this: WorkerGlobalScope, ev: ErrorEvent) => any) | null;
53405340
readonly performance: Performance;
5341-
readonly self: WorkerGlobalScope;
5341+
readonly self: WorkerGlobalScope & typeof globalThis;
53425342
msWriteProfilerMark(profilerMarkName: string): void;
53435343
addEventListener<K extends keyof WorkerGlobalScopeEventMap>(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
53445344
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -5727,7 +5727,7 @@ declare var isSecureContext: boolean;
57275727
declare var location: WorkerLocation;
57285728
declare var onerror: ((this: DedicatedWorkerGlobalScope, ev: ErrorEvent) => any) | null;
57295729
declare var performance: Performance;
5730-
declare var self: WorkerGlobalScope;
5730+
declare var self: WorkerGlobalScope & typeof globalThis;
57315731
declare function msWriteProfilerMark(profilerMarkName: string): void;
57325732
/**
57335733
* Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

inputfiles/overridingTypes.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,9 @@
439439
"override-type": "Event | undefined",
440440
"deprecated": 1
441441
},
442+
"location": {
443+
"read-only": 0
444+
},
442445
"orientation": {
443446
"name": "orientation",
444447
"override-type": "string | number"
@@ -448,8 +451,11 @@
448451
"override-type": "any",
449452
"read-only": 0
450453
},
451-
"location": {
452-
"read-only": 0
454+
"self": {
455+
"override-type": "Window & typeof globalThis"
456+
},
457+
"window": {
458+
"override-type": "Window & typeof globalThis"
453459
}
454460
}
455461
},
@@ -2727,6 +2733,15 @@
27272733
}
27282734
}
27292735
}
2736+
},
2737+
"WorkerGlobalScope": {
2738+
"properties": {
2739+
"property": {
2740+
"self": {
2741+
"override-type": "WorkerGlobalScope & typeof globalThis"
2742+
}
2743+
}
2744+
}
27302745
}
27312746
}
27322747
},

0 commit comments

Comments
 (0)