Commit 5d93296a authored by yangguo's avatar yangguo Committed by Commit bot

[regexp] fix /ui regexp desugaring for text nodes.

R=littledan@chromium.org
BUG=v8:5036

Review-Url: https://codereview.chromium.org/2005753003
Cr-Commit-Position: refs/heads/master@{#36453}
parent b5ab8cc5
......@@ -1473,14 +1473,10 @@ void RegExpBuilder::FlushTerms() {
bool RegExpBuilder::NeedsDesugaringForUnicode(RegExpCharacterClass* cc) {
if (!unicode()) return false;
switch (cc->standard_type()) {
case 's': // white space
case 'w': // ASCII word character
case 'd': // ASCII digit
return false; // These characters do not need desugaring.
default:
break;
}
// TODO(yangguo): we could be smarter than this. Case-insensitivity does not
// necessarily mean that we need to desugar. It's probably nicer to have a
// separate pass to figure out unicode desugarings.
if (ignore_case()) return true;
ZoneList<CharacterRange>* ranges = cc->ranges(zone());
CharacterRange::Canonicalize(ranges);
for (int i = ranges->length() - 1; i >= 0; i--) {
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-unicode-regexps
assertEquals(["1\u212a"], /\d\w/ui.exec("1\u212a"));
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