Closed as not planned
Description
Version
v22.9.0
Platform
Microsoft Windows NT 10.0.19044.0 x64
Subsystem
No response
What steps will reproduce the bug?
❯ node --enable-experimental-regexp-engine
Welcome to Node.js v22.9.0.
Type ".help" for more information.
> /foo/l
/foo/l
> (() => /foo/l)()
/foo/l
> await /foo/l
Uncaught SyntaxError:
await /foo/l
^
Invalid regular expression flag
> await (async () => /foo/l)()
Uncaught SyntaxError:
await (async () => /foo/l)()
^
Invalid regular expression flag
> await (function() { return /foo/l })()
Uncaught SyntaxError:
await (function() { return /foo/l })()
^
Invalid regular expression flag
> await new Promise(resolve => resolve(/foo/l))
Uncaught SyntaxError:
await new Promise(resolve => resolve(/foo/l))
^
Invalid regular expression flag
> await Promise.resolve(/foo/l)
Uncaught SyntaxError:
await Promise.resolve(/foo/l)
^
Invalid regular expression flag
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