Skip to content

Commit

Permalink
fix: filter out not writable "undefined" property from globals
Browse files Browse the repository at this point in the history
this property has been introduced in jsdom 16
taken from d9cfd72
of https://github.com/raiseandfall/aurelia-pal-nodejs
  • Loading branch information
strepon committed Feb 22, 2024
1 parent d1ecfff commit 69227d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand Down

0 comments on commit 69227d3

Please sign in to comment.