Skip to content

enable-experimental-regexp-engine v8 flag doesn't work with promises #55400

Closed as not planned
@brian6932

Description

@brian6932

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    replIssues and PRs related to the REPL subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions