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

Unified Diff: src/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 | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index f468bdca926ff78361f1565792abf227594ba66b..fc32851f4a2833f04273b3e49c4ede06dbcd9154 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -6109,11 +6109,13 @@ void v8::Date::DateTimeConfigurationChangeNotification(Isolate* isolate) {
static i::Handle<i::String> RegExpFlagsToString(RegExp::Flags flags) {
i::Isolate* isolate = i::Isolate::Current();
- uint8_t flags_buf[3];
+ uint8_t flags_buf[5];
int num_flags = 0;
if ((flags & RegExp::kGlobal) != 0) flags_buf[num_flags++] = 'g';
if ((flags & RegExp::kMultiline) != 0) flags_buf[num_flags++] = 'm';
if ((flags & RegExp::kIgnoreCase) != 0) flags_buf[num_flags++] = 'i';
+ if ((flags & RegExp::kSticky) != 0) flags_buf[num_flags++] = 'y';
+ if ((flags & RegExp::kUnicode) != 0) flags_buf[num_flags++] = 'u';
DCHECK(num_flags <= static_cast<int>(arraysize(flags_buf)));
return isolate->factory()->InternalizeOneByteString(
i::Vector<const uint8_t>(flags_buf, num_flags));
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698