Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Unified Diff: test/cctest/test-regexp.cc

Issue 788043005: ES6 unicode escapes, part 2: Regexps. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: error reporting Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/cctest/test-regexp.cc
diff --git a/test/cctest/test-regexp.cc b/test/cctest/test-regexp.cc
index 4a572c8160d4cde8b50d76e3082c9fdaa75ce186..4ca5c362685fee027ab328eba5226b9308d0a228 100644
--- a/test/cctest/test-regexp.cc
+++ b/test/cctest/test-regexp.cc
@@ -89,8 +89,8 @@ static bool CheckParse(const char* input) {
Zone zone(CcTest::i_isolate());
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
RegExpCompileData result;
- return v8::internal::RegExpParser::ParseRegExp(
- &reader, false, &result, &zone);
+ return v8::internal::RegExpParser::ParseRegExp(&reader, false, false, &result,
+ &zone);
}
@@ -99,8 +99,8 @@ static void CheckParseEq(const char* input, const char* expected) {
Zone zone(CcTest::i_isolate());
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
RegExpCompileData result;
- CHECK(v8::internal::RegExpParser::ParseRegExp(
- &reader, false, &result, &zone));
+ CHECK(v8::internal::RegExpParser::ParseRegExp(&reader, false, false, &result,
+ &zone));
CHECK(result.tree != NULL);
CHECK(result.error.is_null());
std::ostringstream os;
@@ -114,8 +114,8 @@ static bool CheckSimple(const char* input) {
Zone zone(CcTest::i_isolate());
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
RegExpCompileData result;
- CHECK(v8::internal::RegExpParser::ParseRegExp(
- &reader, false, &result, &zone));
+ CHECK(v8::internal::RegExpParser::ParseRegExp(&reader, false, false, &result,
+ &zone));
CHECK(result.tree != NULL);
CHECK(result.error.is_null());
return result.simple;
@@ -132,8 +132,8 @@ static MinMaxPair CheckMinMaxMatch(const char* input) {
Zone zone(CcTest::i_isolate());
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
RegExpCompileData result;
- CHECK(v8::internal::RegExpParser::ParseRegExp(
- &reader, false, &result, &zone));
+ CHECK(v8::internal::RegExpParser::ParseRegExp(&reader, false, false, &result,
+ &zone));
CHECK(result.tree != NULL);
CHECK(result.error.is_null());
int min_match = result.tree->min_match();
@@ -405,8 +405,8 @@ static void ExpectError(const char* input,
Zone zone(CcTest::i_isolate());
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
RegExpCompileData result;
- CHECK(!v8::internal::RegExpParser::ParseRegExp(
- &reader, false, &result, &zone));
+ CHECK(!v8::internal::RegExpParser::ParseRegExp(&reader, false, false, &result,
+ &zone));
CHECK(result.tree == NULL);
CHECK(!result.error.is_null());
SmartArrayPointer<char> str = result.error->ToCString(ALLOW_NULLS);
@@ -497,16 +497,17 @@ TEST(CharacterClassEscapes) {
}
-static RegExpNode* Compile(const char* input, bool multiline, bool is_one_byte,
- Zone* zone) {
+static RegExpNode* Compile(const char* input, bool multiline, bool unicode,
+ bool is_one_byte, Zone* zone) {
Isolate* isolate = CcTest::i_isolate();
FlatStringReader reader(isolate, CStrVector(input));
RegExpCompileData compile_data;
- if (!v8::internal::RegExpParser::ParseRegExp(&reader, multiline,
+ if (!v8::internal::RegExpParser::ParseRegExp(&reader, multiline, unicode,
&compile_data, zone))
return NULL;
- Handle<String> pattern = isolate->factory()->
- NewStringFromUtf8(CStrVector(input)).ToHandleChecked();
+ Handle<String> pattern = isolate->factory()
+ ->NewStringFromUtf8(CStrVector(input))
+ .ToHandleChecked();
Handle<String> sample_subject =
isolate->factory()->NewStringFromUtf8(CStrVector("")).ToHandleChecked();
RegExpEngine::Compile(&compile_data, false, false, multiline, false, pattern,
@@ -515,11 +516,11 @@ static RegExpNode* Compile(const char* input, bool multiline, bool is_one_byte,
}
-static void Execute(const char* input, bool multiline, bool is_one_byte,
- bool dot_output = false) {
+static void Execute(const char* input, bool multiline, bool unicode,
+ bool is_one_byte, bool dot_output = false) {
v8::HandleScope scope(CcTest::isolate());
Zone zone(CcTest::i_isolate());
- RegExpNode* node = Compile(input, multiline, is_one_byte, &zone);
+ RegExpNode* node = Compile(input, multiline, unicode, is_one_byte, &zone);
USE(node);
#ifdef DEBUG
if (dot_output) {

Powered by Google App Engine
This is Rietveld 408576698