mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
Use globalThis to reference global scope (#3719)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
parent
23e67eb515
commit
60b53fd6b6
19 changed files with 219 additions and 264 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue