Use globalThis to reference global scope (#3719)

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
Kitson Kelly 2020-01-21 01:30:30 +11:00 committed by Ry Dahl
parent 23e67eb515
commit 60b53fd6b6
19 changed files with 219 additions and 264 deletions

View file

@ -2,7 +2,6 @@
import { URL } from "./url.ts";
import { notImplemented } from "./util.ts";
import { Location } from "./dom_types.ts";
import { window } from "./window.ts";
export class LocationImpl implements Location {
constructor(url: string) {
@ -47,6 +46,6 @@ export class LocationImpl implements Location {
}
export function setLocation(url: string): void {
window.location = new LocationImpl(url);
Object.freeze(window.location);
globalThis.location = new LocationImpl(url);
Object.freeze(globalThis.location);
}