Skip to content

Commit

Permalink
#1082@patch: Fixes issue related to functions not being bound to glob…
Browse files Browse the repository at this point in the history
…al when using GlobalRegistrator from @happy-dom/global-registrator.
  • Loading branch information
capricorn86 committed Sep 20, 2023
1 parent 52009a7 commit 9e0067d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/global-registrator/src/GlobalRegistrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class GlobalRegistrator {
if (global[key] !== window[key] && !IGNORE_LIST.includes(key)) {
this.registered[key] =
global[key] !== window[key] && global[key] !== undefined ? global[key] : null;
global[key] = window[key];
global[key] = typeof window[key] === 'function' ? window[key].bind(global) : window[key];
}
}

Expand Down

0 comments on commit 9e0067d

Please sign in to comment.