mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-24 03:58:53 +00:00
Merge pull request #326 from tidalcycles/eval-fix-node
fix: workaround Object.assign globalThis
This commit is contained in:
commit
2ceafe6379
@ -19,7 +19,14 @@ export const evalScope = async (...args) => {
|
|||||||
console.warn(`evalScope: module with index ${i} could not be loaded:`, result.reason);
|
console.warn(`evalScope: module with index ${i} could not be loaded:`, result.reason);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Object.assign(globalThis, ...modules);
|
// Object.assign(globalThis, ...modules);
|
||||||
|
// below is a fix for above commented out line
|
||||||
|
// same error as https://github.com/vitest-dev/vitest/issues/1807 when running this on astro server
|
||||||
|
modules.forEach((module) => {
|
||||||
|
Object.entries(module).forEach(([name, value]) => {
|
||||||
|
globalThis[name] = value;
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function safeEval(str, options = {}) {
|
function safeEval(str, options = {}) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user