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

Unified Diff: src/runtime/runtime-literals.cc

Issue 1472323002: [es6] Correct parsing of regular expression literal flags. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix oversight in interpreter 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/regexp/jsregexp.cc ('k') | src/runtime/runtime-regexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-literals.cc
diff --git a/src/runtime/runtime-literals.cc b/src/runtime/runtime-literals.cc
index ce1dc243087c16677de572993c174de1940a45a7..01d1fe8aaa6007cf2ebe14701661b0c42e6bae80 100644
--- a/src/runtime/runtime-literals.cc
+++ b/src/runtime/runtime-literals.cc
@@ -242,13 +242,13 @@ RUNTIME_FUNCTION(Runtime_CreateRegExpLiteral) {
CONVERT_ARG_HANDLE_CHECKED(JSFunction, closure, 0);
CONVERT_SMI_ARG_CHECKED(index, 1);
CONVERT_ARG_HANDLE_CHECKED(String, pattern, 2);
- CONVERT_ARG_HANDLE_CHECKED(String, flags, 3);
+ CONVERT_SMI_ARG_CHECKED(flags, 3);
// Check if boilerplate exists. If not, create it first.
Handle<Object> boilerplate(closure->literals()->literal(index), isolate);
if (boilerplate->IsUndefined()) {
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, boilerplate,
- JSRegExp::New(pattern, flags));
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, boilerplate, JSRegExp::New(pattern, JSRegExp::Flags(flags)));
closure->literals()->set_literal(index, *boilerplate);
}
return *JSRegExp::Copy(Handle<JSRegExp>::cast(boilerplate));
« no previous file with comments | « src/regexp/jsregexp.cc ('k') | src/runtime/runtime-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698