- Notifications
You must be signed in to change notification settings - Fork 122
Closed
Description
Thanks so much for this project!
Bug
Starting from version 0.28.0, when evaluating code as an ES module, evalCode won't return the error.
For example, the result won't have an error prop in the following code (test in browser):
import { getQuickJS } from 'quickjs-emscripten'; async function main() { const QuickJS = await getQuickJS(); const vm = QuickJS.newContext(); const world = vm.newString('world'); vm.setProp(vm.global, 'NAME', world); world.dispose(); const result = vm.evalCode(`(null).abc;"Hello " + NAME + "!"`, '', { strict: true, type: 'module', }); if (result.error) { console.log('Execution failed:', vm.dump(result.error)); result.error.dispose(); } else { console.log('Success:', vm.dump(result.value)); result.value.dispose(); } vm.dispose(); }Metadata
Metadata
Assignees
Labels
No labels