We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 323d9c8 commit 97ae91eCopy full SHA for 97ae91e
1 file changed
js/unpickler.js
@@ -350,7 +350,14 @@ export function loadclass(module_and_name) {
350
if (module_and_name.indexOf(main_check) === 0) {
351
module_and_name = module_and_name.slice(main_check.length);
352
}
353
- let parent = window;
+ let parent;
354
+ if (typeof globalThis !== 'undefined') {
355
+ parent = globalThis;
356
+ } else if (typeof window !== 'undefined') {
357
+ parent = window;
358
+ } else if (typeof global !== 'undefined') {
359
+ parent = global;
360
+ }
361
const module_class_split = module_and_name.split('.');
362
for (let i = 0; i < module_class_split.length; i++) {
363
const this_module_or_class = module_class_split[i];
0 commit comments