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

[Bug]: The RegExp constructor does not raise a SyntaxError for octal escapes in Unicode mode #7015

Open
ayuan0828 opened this issue Mar 1, 2025 · 0 comments
Labels

Comments

@ayuan0828
Copy link

ChakraCore Version

36becec

Steps to reproduce

When using the RegExp constructor to create a regular expression with the u flag, if the pattern contains an octal escape sequence , the engine does not raise a SyntaxError according to the specification, but silently returns an invalid regular expression object. This behavior violates the ECMAScript standard.

Proof of concept

print(RegExp('[\\03]', 'u'));

Exception or Error

/[\03]/u

Additional Context

The expected output should throw "SyntaxError".

@ayuan0828 ayuan0828 added the Bug label Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant