Open DPOH-VAR opened 2 months ago
v8 and JavaScript added top-level await after the implementation in isolated-vm, so this is probably just a limitation of the current implementation. I've been working on a rewrite but obviously that won't help you now, since that won't be ready for quite some time. You can probably work around it today by injecting a promise resolution at the end of the module and waiting on that instead.
JavaScript includes a setTimeout function: yes Functions are a type of primitive value in JavaScript: yes Objects can be shared between isolates: no
Is there a way to wait for an async module to execute?
I get an error when accessing variable
y
But this code wotks fine:
I think
async module.evaluate
resolves before the module is executed.Is it possible to get Promise or callback when the module will be executed to the end?