diff --git a/common.gypi b/common.gypi index 214edd31cd8..03ed837f607 100644 --- a/common.gypi +++ b/common.gypi @@ -44,7 +44,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.47', + 'v8_embedder_string': '-node.48', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/regexp/regexp-compiler.cc b/deps/v8/src/regexp/regexp-compiler.cc index 397361031e5..ba1452be9fc 100644 --- a/deps/v8/src/regexp/regexp-compiler.cc +++ b/deps/v8/src/regexp/regexp-compiler.cc @@ -3889,11 +3889,13 @@ class Analysis : public NodeVisitor { NegativeLookaroundChoiceNode* that) override { DCHECK_EQ(that->alternatives()->length(), 2); // Lookaround and continue. + RegExpFlags header_flags = flags(); EnsureAnalyzed(that->lookaround_node()); if (has_failed()) return; STATIC_FOR_EACH( Propagators::VisitNegativeLookaroundChoiceLookaroundNode(that)); + set_flags(header_flags); EnsureAnalyzed(that->continue_node()); if (has_failed()) return; STATIC_FOR_EACH( diff --git a/deps/v8/test/mjsunit/regexp-modifiers.js b/deps/v8/test/mjsunit/regexp-modifiers.js index a57f266b606..91b1f2364bd 100644 --- a/deps/v8/test/mjsunit/regexp-modifiers.js +++ b/deps/v8/test/mjsunit/regexp-modifiers.js @@ -102,3 +102,11 @@ test(/(?i:\.|\bnuLl)/, ['null', 'NULL']); test(/(?i:\.|\bnulL)/, ['null', 'NULL']); test(/(?-i:(?i:\.|\bNULL))/, ['null', 'NULL', '.foo'], ['xyz']); test(/(?i:(?-i:\.|\bNULL))/, ['NULL', '.foo'], ['null', 'xyz']); + +// A modifier group inside a negative lookaround must not leak its flags into +// the continuation. Analysis visits the two branches of the lookaround choice +// in sequence, so without a reset the continuation's classes are made case +// independent under the group's flags rather than the pattern's. +test(/(?!(?i:x|y))[K]/, ['K'], ['k']); +test(/(?