From f989485776baca17dcfdff55fa44598d79b07cdd Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 24 Oct 2022 09:05:13 -0700 Subject: [PATCH] chore: update selfWindow to rootWindow (#397) --- packages/near-membrane-dom/src/window.ts | 6 +++--- packages/near-membrane-shared-dom/src/Window.ts | 2 +- .../near-membrane-shared-dom/src/__tests__/Window.spec.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/near-membrane-dom/src/window.ts b/packages/near-membrane-dom/src/window.ts index e77b8ee1..7d5d7101 100644 --- a/packages/near-membrane-dom/src/window.ts +++ b/packages/near-membrane-dom/src/window.ts @@ -5,7 +5,7 @@ import { ReflectOwnKeys, toSafeWeakMap, } from '@locker/near-membrane-shared'; -import { selfWindow } from '@locker/near-membrane-shared-dom'; +import { rootWindow } from '@locker/near-membrane-shared-dom'; interface CachedBlueReferencesRecord extends Object { document: Document; @@ -31,7 +31,7 @@ export const unforgeablePoisonedWindowKeys = (() => { // to avoid triggering its getter. navigator, navigator: { userAgentData }, - }: any = selfWindow; + }: any = rootWindow; // The user-agent client hints API is experimental and subject to change. // https://caniuse.com/mdn-api_navigator_useragentdata const brands: { brand: string; version: string }[] = userAgentData?.brands; @@ -152,4 +152,4 @@ export function removeWindowDescriptors(unsafeD * usually help because this library runs before anything else that can poison * the environment. */ -getCachedGlobalObjectReferences(selfWindow); +getCachedGlobalObjectReferences(rootWindow); diff --git a/packages/near-membrane-shared-dom/src/Window.ts b/packages/near-membrane-shared-dom/src/Window.ts index e8b95f7f..bc7921df 100644 --- a/packages/near-membrane-shared-dom/src/Window.ts +++ b/packages/near-membrane-shared-dom/src/Window.ts @@ -1 +1 @@ -export const selfWindow = window; +export const rootWindow = window; diff --git a/packages/near-membrane-shared-dom/src/__tests__/Window.spec.js b/packages/near-membrane-shared-dom/src/__tests__/Window.spec.js index d8192f26..cd47d1d7 100644 --- a/packages/near-membrane-shared-dom/src/__tests__/Window.spec.js +++ b/packages/near-membrane-shared-dom/src/__tests__/Window.spec.js @@ -1,7 +1,7 @@ -import { selfWindow } from '../../dist/index'; +import { rootWindow } from '../../dist/index'; describe('Window', () => { - it('selfWindow', () => { - expect(selfWindow).toBe(window); + it('rootWindow', () => { + expect(rootWindow).toBe(window); }); });