Skip to content

JS_DetectModule does not (always) detect TLA #606

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

Closed
bnoordhuis opened this issue Oct 18, 2024 · 1 comment · Fixed by #610
Closed

JS_DetectModule does not (always) detect TLA #606

bnoordhuis opened this issue Oct 18, 2024 · 1 comment · Fixed by #610
Labels
bug Something isn't working

Comments

@bnoordhuis
Copy link
Contributor

Works:

await Promise.resolve(42)

Does not work:

const p = Promise.resolve(42)
await p // SyntaxError: expecting ';'

Looks like 6dd2ce3 was only a partial fix?

@bnoordhuis bnoordhuis added the bug Something isn't working label Oct 18, 2024
@saghul
Copy link
Contributor

saghul commented Oct 18, 2024

Yes, the detection is quite naive and only checks the 1st line after skipping comments iirc.

bnoordhuis added a commit to bnoordhuis/quickjs that referenced this issue Oct 19, 2024
It's still not infallible (I don't think it can ever be, the whole
premise is wrong) but hopefully it's a little less fallible now.

Fixes: quickjs-ng#606
bluesky950520 pushed a commit to bluesky950520/quickjs that referenced this issue Mar 14, 2025
It's still not infallible (I don't think it can ever be, the whole
premise is wrong) but hopefully it's a little less fallible now.

Fixes: quickjs-ng/quickjs#606
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

Successfully merging a pull request may close this issue.

2 participants