Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in async top-level functions do not result in traps #627

Open
jeffcharles opened this issue Apr 9, 2024 · 1 comment
Open

Errors in async top-level functions do not result in traps #627

jeffcharles opened this issue Apr 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jeffcharles
Copy link
Collaborator

jeffcharles commented Apr 9, 2024

Operating system: MacOS 14.4.1 (Sanoma)
Processor architecture: Apple M3
Rust version: 1.77.1
Javy version: f270956

Problem

Errors in async functions do not result in error messages or traps.

Error Message and Context

Compiling and running:

(async function() {
    adfasdfsa;
})();

should throw a syntax error and trap. Right now it exits successfully with no error messages.

This does not require the experimental_event_loop feature to be enabled.

@jeffcharles jeffcharles added the bug Something isn't working label Apr 9, 2024
@jeffcharles jeffcharles changed the title Errors when processing event loop do not result in traps Errors in async top-level functions do not result in traps Apr 9, 2024
@jeffcharles
Copy link
Collaborator Author

It looks like this behaviour reproduces with the latest native QuickJS:

➜  quickjs git:(master) ./qjs    
QuickJS - Type "\h" for help
qjs > (async function() {
({  ...         asdfasd;
({  ...         })()
{  }
qjs > (function() {
({  ...         asdfasdf;
({  ...         })()
ReferenceError: 'asdfasdf' is not defined
    at <anonymous> (<evalScript>:2)
    at <eval> (<evalScript>:3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant