From 904ddfa28f82b2cc5071c3c24db941b777a88dfa Mon Sep 17 00:00:00 2001 From: Martok Date: Sun, 25 Dec 2022 16:41:45 +0100 Subject: [PATCH] Follow-up #2060 - Correctly handle \k in non-unicode expressions --- js/src/irregexp/RegExpParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/irregexp/RegExpParser.cpp b/js/src/irregexp/RegExpParser.cpp index 0deb3c658d..c609f5940d 100644 --- a/js/src/irregexp/RegExpParser.cpp +++ b/js/src/irregexp/RegExpParser.cpp @@ -2069,8 +2069,8 @@ RegExpParser::ParseDisjunction() // an identity escape for non-Unicode patterns without named // capture groups, and as the beginning of a named back-reference // in all other cases. + Advance(2); if (unicode_ || HasNamedCaptures()) { - Advance(2); if (!ParseNamedBackReference(builder, state)) { return ReportError(JSMSG_INVALID_IDENTITY_ESCAPE); }