-
Notifications
You must be signed in to change notification settings - Fork 30k
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
enable-experimental-regexp-engine
v8 flag doesn't work with promises
#55400
Comments
This seems to be only reproducible in the REPL, and not via an actual script. It probably has to do with top-level await. |
Lines 3472 to 3476 in d6175b3
You would probably get better results by passing |
I understand, I've ran into this in more than just Node repl (in some eval sandboxes lacking top-level await), and believe there's an underlying v8 or Node bug somewhere here. I don't have enough info as to why it happens though. It's kinda interesting that it's only occurring with the primitive, and not the constructor. |
This issue is caused by acorn doesn't support linear regex. Top-level await is not handled by V8 directly, in order to support top-level await, Node use acorn to parse and preprocess top-level await code(see #15566). Why it doesn't happen when using Regex constructor like |
Version
v22.9.0
Platform
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
The linear regex must be created, and wrapped in a Promise, closures experience no such issues.
What is the expected behavior? Why is that the expected behavior?
The linear flag should be parsed and executed as expected.
What do you see instead?
Invalid regular expression flag
Additional information
No response
The text was updated successfully, but these errors were encountered: