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

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

Issue 1457883003: Correctly parse new regexp flags in v8::RegExp::New. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 219059e407c0b88400f674e2f7a3d3ffe498670c..8a3d14c7a0285c2ec4418a398f8a0aa99e687c36 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -17483,6 +17483,8 @@ TEST(PersistentHandleInNewSpaceVisitor) {
TEST(RegExp) {
+ i::FLAG_harmony_regexps = true;
+ i::FLAG_harmony_unicode_regexps = true;
LocalContext context;
v8::HandleScope scope(context->GetIsolate());
@@ -17507,6 +17509,14 @@ TEST(RegExp) {
CHECK_EQ(v8::RegExp::kIgnoreCase | v8::RegExp::kMultiline,
static_cast<int>(re->GetFlags()));
+ re = v8::RegExp::New(v8_str("baz"),
+ static_cast<v8::RegExp::Flags>(v8::RegExp::kUnicode |
+ v8::RegExp::kSticky));
+ CHECK(re->IsRegExp());
+ CHECK(re->GetSource()->Equals(v8_str("baz")));
+ CHECK_EQ(v8::RegExp::kUnicode | v8::RegExp::kSticky,
+ static_cast<int>(re->GetFlags()));
+
re = CompileRun("/quux/").As<v8::RegExp>();
CHECK(re->IsRegExp());
CHECK(re->GetSource()->Equals(v8_str("quux")));
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698