puter/experiments/x86emu/www/js/V86Wrapper.mjs
KernelDeimos 0b39c76c40 move: incubator to experiments
This name is easier to understand and more generalizable.
2024-07-09 03:19:31 -04:00

17 lines
371 B
JavaScript

let V86;
if (typeof window !== 'undefined') {
V86 = window.V86;
} else {
try {
const { createRequire } = await import('module');
const require = createRequire(import.meta.url);
const NodeV86 = require("../third-party/libv86.js");
V86 = NodeV86.V86;
} catch (error) {
console.error('Failed to load V86 in Node.js environment:', error);
}
}
export { V86 };