You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No error showed when error threw with --module flag #363
/* example of JS module */import{fib}from"./fib_module.js";// here I throw an ErrorthrownewError('test error');console.log("Hello World");console.log("fib(10)=",fib(10));
When I execute qjs ./examples/hello_module.js, no error showed
I confirm this error for a version 2024-01-13. After rolling back to version 2023-12-09 the errors started to appear.
I am using the QuickJS API, not the CLI. When I call JS_Eval with a broken script and JS_EVAL_TYPE_GLOBAL flag then it returns JS exception (it's normal):
The CLI won't exit with an error in async functions. We fixed that in NG: quickjs-ng/quickjs#514
Thank you, I upstreamed part of that into a PR for this repository #386 but it needs review for any needed workflow changes + test if someone more familiar with the project could take on the mantle.
@saghul If quickjs-ng is updated to support cosmopolitan libc builds, I would definitely consider switching over. For now, only this project is already geared for it.
Activity
navrocky commentedon Nov 7, 2024
I confirm this error for a version 2024-01-13. After rolling back to version 2023-12-09 the errors started to appear.
I am using the QuickJS API, not the CLI. When I call
JS_Evalwith a broken script andJS_EVAL_TYPE_GLOBALflag then it returns JS exception (it's normal):But if I use the
JS_EVAL_TYPE_MODULEflag thenJS_Evalsilently terminates without any errors or exceptions and returns JSValue with JS_TAG_MODULE:Logging insertions into the script shows that execution flow aborted right at the point of the error.
In version 2023-12-09 everything works with modules as expected.
bnoordhuis commentedon Nov 15, 2024
Does it work when you pass the JS_Eval result to JS_EvalFunction? And in turn pass that result to js_std_await?
I didn't test with the code from this repo but in quickjs-ng it works as expected.
XuJiandong commentedon Jan 6, 2025
a very minimal reproducible case:
saghul commentedon Jan 6, 2025
The CLI won't exit with an error in async functions. We fixed that in NG: quickjs-ng/quickjs#514
soulofmischief commentedon Mar 11, 2025
Thank you, I upstreamed part of that into a PR for this repository #386 but it needs review for any needed workflow changes + test if someone more familiar with the project could take on the mantle.
saghul commentedon Mar 12, 2025
This project hasn't seen an update in months. Just use NG :-)
soulofmischief commentedon Mar 13, 2025
@saghul If quickjs-ng is updated to support cosmopolitan libc builds, I would definitely consider switching over. For now, only this project is already geared for it.
saghul commentedon Mar 13, 2025
navrocky commentedon Mar 13, 2025
I can't use
quickjs-ngbecause it's not published on conan.io (saghul commentedon Mar 13, 2025
You can compile it yourself or use one of the prebuilt binaries.
bellard commentedon Mar 13, 2025
works as expected with the current version.