Commit 43862c2c authored by Martin Bidlingmaier's avatar Martin Bidlingmaier Committed by Commit Bot

[regexp] Fix assert about unicode in experimental engine

Follow up to 3f4f4a0d: "[regexp] Handle zero-length matches in
experimental engine".

We want to assert an equivalence, not an implication in the boring
direction.

Bug: v8:10765
Change-Id: Ia7b4851feb1f5f621d687779d0cae0e28433f00e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2398536Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Martin Bidlingmaier <mbid@google.com>
Cr-Commit-Position: refs/heads/master@{#69764}
parent cb1a96e5
......@@ -36,8 +36,9 @@ class CanBeHandledVisitor final : private RegExpVisitor {
// TODO(mbid, v8:10765): We should be able to support all flags in the
// future.
static constexpr JSRegExp::Flags kAllowedFlags = JSRegExp::kGlobal;
STATIC_ASSERT(!ExperimentalRegExp::kSupportsUnicode ||
(kAllowedFlags & JSRegExp::kUnicode) == 0);
// We support Unicode iff kUnicode is among the supported flags.
STATIC_ASSERT(ExperimentalRegExp::kSupportsUnicode ==
((kAllowedFlags & JSRegExp::kUnicode) != 0));
return (flags & ~kAllowedFlags) == 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment