diff --git a/crates/oxc_regular_expression/src/ast_impl/display.rs b/crates/oxc_regular_expression/src/ast_impl/display.rs index 04f0012c3..a0156c21f 100644 --- a/crates/oxc_regular_expression/src/ast_impl/display.rs +++ b/crates/oxc_regular_expression/src/ast_impl/display.rs @@ -339,6 +339,7 @@ fn character_to_string( '\n' => Cow::Borrowed(r"\cJ"), '\r' => Cow::Borrowed(r"\cM"), '\t' => Cow::Borrowed(r"\cI"), + '\u{0019}' => Cow::Borrowed(r"\cY"), _ => Cow::Owned(format!(r"\c{ch}")), }, CharacterKind::Identifier => Cow::Owned(format!(r"\{ch}")), @@ -479,6 +480,7 @@ mod test { (r"/\d/g", None), ("/abcd/igv", Some("/abcd/igv")), (r"/\d/ug", Some(r"/\d/ug")), + (r"/\cY/", None), // we capitalize hex unicodes. (r"/\n\cM\0\x41\u{1f600}\./u", Some(r"/\n\cM\0\x41\u{1F600}\./u")), (r"/\u02c1/u", Some(r"/\u02C1/u")), diff --git a/tasks/coverage/snapshots/parser_test262.snap b/tasks/coverage/snapshots/parser_test262.snap index e0f300e43..5d68c7135 100644 --- a/tasks/coverage/snapshots/parser_test262.snap +++ b/tasks/coverage/snapshots/parser_test262.snap @@ -2,13 +2,10 @@ commit: d62fa93c parser_test262 Summary: AST Parsed : 43914/43914 (100.00%) -Positive Passed: 43913/43914 (100.00%) +Positive Passed: 43914/43914 (100.00%) Negative Passed: 4320/4322 (99.95%) Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attributes/json-invalid.js Expect Syntax Error: tasks/coverage/test262/test/language/import/import-attributes/json-named-bindings.js -Expect to Parse: tasks/coverage/test262/test/built-ins/String/prototype/split/separator-regexp.js - - × Regular Expression content mismatch for `/\cY/`: `\c` == `\c` × '0'-prefixed octal literals and octal escape sequences are deprecated ╭─[test262/test/annexB/language/expressions/template-literal/legacy-octal-escape-sequence-strict.js:19:4] diff --git a/tasks/coverage/snapshots/semantic_test262.snap b/tasks/coverage/snapshots/semantic_test262.snap index 9a4c34053..420d23064 100644 --- a/tasks/coverage/snapshots/semantic_test262.snap +++ b/tasks/coverage/snapshots/semantic_test262.snap @@ -2,7 +2,7 @@ commit: d62fa93c semantic_test262 Summary: AST Parsed : 43914/43914 (100.00%) -Positive Passed: 43713/43914 (99.54%) +Positive Passed: 43714/43914 (99.54%) tasks/coverage/test262/test/annexB/language/function-code/if-decl-else-decl-a-func-block-scoping.js semantic error: Symbol scope ID mismatch for "f": after transform: SymbolId(3): ScopeId(4294967294) @@ -1119,9 +1119,6 @@ semantic error: Symbol scope ID mismatch for "f": after transform: SymbolId(0): ScopeId(4294967294) rebuilt : SymbolId(0): ScopeId(4294967294) -tasks/coverage/test262/test/built-ins/String/prototype/split/separator-regexp.js -semantic error: Regular Expression content mismatch for `/\cY/`: `\c` == `\c` - tasks/coverage/test262/test/language/module-code/eval-rqstd-once.js semantic error: Bindings mismatch: after transform: ScopeId(0): ["dflt1", "dflt2", "dflt3", "global", "ns1", "ns3"]