ChakraCore icon indicating copy to clipboard operation
ChakraCore copied to clipboard

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

Open ayuan0828 opened this issue 9 months ago • 0 comments

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 avatar Mar 01 '25 03:03 ayuan0828