Skip to content

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

Description

@ayuan0828

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".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions