Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@happy-dom/global-registrator

Package Overview
Dependencies
Maintainers
0
Versions
470
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@happy-dom/global-registrator - npm Package Compare versions

Comparing version 15.8.1 to 15.8.2

24

lib/GlobalRegistrator.js

@@ -21,3 +21,3 @@ import { GlobalWindow, PropertySymbol } from 'happy-dom';

}
const window = new GlobalWindow({ ...options, console: global.console });
const window = new GlobalWindow({ ...options, console: globalThis.console });
this.registered = {};

@@ -29,3 +29,3 @@ // Define properties on the global object

const windowPropertyDescriptor = propertyDescriptors[key];
const globalPropertyDescriptor = Object.getOwnPropertyDescriptor(global, key);
const globalPropertyDescriptor = Object.getOwnPropertyDescriptor(globalThis, key);
if (globalPropertyDescriptor?.value === undefined ||

@@ -36,6 +36,6 @@ globalPropertyDescriptor?.value !== windowPropertyDescriptor.value) {

if (windowPropertyDescriptor.value === window) {
window[key] = global;
windowPropertyDescriptor.value = global;
window[key] = globalThis;
windowPropertyDescriptor.value = globalThis;
}
Object.defineProperty(global, key, {
Object.defineProperty(globalThis, key, {
...windowPropertyDescriptor,

@@ -54,6 +54,6 @@ configurable: true

if (propertyDescriptor.value === window) {
window[key] = global;
propertyDescriptor.value = global;
window[key] = globalThis;
propertyDescriptor.value = globalThis;
}
Object.defineProperty(global, key, {
Object.defineProperty(globalThis, key, {
...propertyDescriptor,

@@ -64,3 +64,3 @@ configurable: true

// Set owner window on document to global
global.document[PropertySymbol.defaultView] = global;
globalThis.document[PropertySymbol.defaultView] = globalThis;
}

@@ -74,9 +74,9 @@ /**

}
const happyDOM = global.happyDOM;
const happyDOM = globalThis.happyDOM;
for (const key of Object.keys(this.registered)) {
if (this.registered[key] !== null) {
Object.defineProperty(global, key, this.registered[key]);
Object.defineProperty(globalThis, key, this.registered[key]);
}
else {
delete global[key];
delete globalThis[key];
}

@@ -83,0 +83,0 @@ }

{
"name": "@happy-dom/global-registrator",
"version": "15.8.1",
"version": "15.8.2",
"license": "MIT",

@@ -79,3 +79,3 @@ "homepage": "https://github.com/capricorn86/happy-dom/tree/master/packages/global-registrator",

"dependencies": {
"happy-dom": "^15.8.1"
"happy-dom": "^15.8.2"
},

@@ -82,0 +82,0 @@ "devDependencies": {

@@ -31,3 +31,3 @@ import { GlobalWindow, PropertySymbol } from 'happy-dom';

const window = new GlobalWindow({ ...options, console: global.console });
const window = new GlobalWindow({ ...options, console: globalThis.console });

@@ -42,3 +42,3 @@ this.registered = {};

const windowPropertyDescriptor = propertyDescriptors[key];
const globalPropertyDescriptor = Object.getOwnPropertyDescriptor(global, key);
const globalPropertyDescriptor = Object.getOwnPropertyDescriptor(globalThis, key);

@@ -53,7 +53,7 @@ if (

if (windowPropertyDescriptor.value === window) {
window[key] = global;
windowPropertyDescriptor.value = global;
window[key] = globalThis;
windowPropertyDescriptor.value = globalThis;
}
Object.defineProperty(global, key, {
Object.defineProperty(globalThis, key, {
...windowPropertyDescriptor,

@@ -75,7 +75,7 @@ configurable: true

if (propertyDescriptor.value === window) {
window[key] = global;
propertyDescriptor.value = global;
window[key] = globalThis;
propertyDescriptor.value = globalThis;
}
Object.defineProperty(global, key, {
Object.defineProperty(globalThis, key, {
...propertyDescriptor,

@@ -87,3 +87,3 @@ configurable: true

// Set owner window on document to global
global.document[PropertySymbol.defaultView] = global;
globalThis.document[PropertySymbol.defaultView] = globalThis;
}

@@ -101,9 +101,9 @@

const happyDOM = global.happyDOM;
const happyDOM = globalThis.happyDOM;
for (const key of Object.keys(this.registered)) {
if (this.registered[key] !== null) {
Object.defineProperty(global, key, this.registered[key]);
Object.defineProperty(globalThis, key, this.registered[key]);
} else {
delete global[key];
delete globalThis[key];
}

@@ -110,0 +110,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc