This commit is contained in:
Adria Navarro 2024-02-13 16:30:02 +01:00
parent 53d4fc2fa0
commit f03d9a0178
1 changed files with 0 additions and 20 deletions

View File

@ -93,26 +93,6 @@ export class IsolatedVM implements VM {
} }
}` }`
const helpersSource = loadBundle(BundleType.HELPERS) const helpersSource = loadBundle(BundleType.HELPERS)
// const helpersModule = this.isolate.compileModuleSync(
// `${injectedRequire};${helpersSource}`
// )
// helpersModule.instantiateSync(this.vm, specifier => {
// if (specifier === "crypto") {
// const cryptoModule = this.registerCallbacks({
// randomUUID: crypto.randomUUID,
// })
// const module = this.isolate.compileModuleSync(
// `export default ${cryptoModule}`
// )
// module.instantiateSync(this.vm, specifier => {
// throw new Error(`No imports allowed. Required: ${specifier}`)
// })
// return module
// }
// throw new Error(`No imports allowed. Required: ${specifier}`)
// })
this.moduleHandler.registerModule(`${injectedRequire};${helpersSource}`) this.moduleHandler.registerModule(`${injectedRequire};${helpersSource}`)
return this return this
} }