From 69227d3bb56daa99ffc9e61a80c93d1da8516389 Mon Sep 17 00:00:00 2001 From: Stanislav Horacek Date: Thu, 22 Feb 2024 11:26:13 +0100 Subject: [PATCH] fix: filter out not writable "undefined" property from globals this property has been introduced in jsdom 16 taken from d9cfd727bb178542ca3e61d38d8abc93d3ceb064 of https://github.com/raiseandfall/aurelia-pal-nodejs --- dist/index.js | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index d28dfea..da16c93 100644 --- a/dist/index.js +++ b/dist/index.js @@ -66,7 +66,7 @@ function initialize() { exports.initialize = initialize; function createBrowserGlobals() { Object.getOwnPropertyNames(aurelia_pal_1.PLATFORM.global) - .filter(prop => typeof global[prop] === 'undefined') + .filter(prop => typeof global[prop] === 'undefined' && prop !== 'undefined') .forEach(prop => global[prop] = aurelia_pal_1.PLATFORM.global[prop]); } function globalize() { diff --git a/src/index.ts b/src/index.ts index 1c59f99..b82bf78 100644 --- a/src/index.ts +++ b/src/index.ts @@ -75,7 +75,7 @@ export function initialize(): void { function createBrowserGlobals() { Object.getOwnPropertyNames(PLATFORM.global) // avoid conflict with nodejs globals - .filter(prop => typeof global[prop] === 'undefined') + .filter(prop => typeof global[prop] === 'undefined' && prop !== 'undefined') .forEach(prop => global[prop] = PLATFORM.global[prop]); }