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

Unified Diff: src/objects.cc

Issue 1972093003: Fix RegExp.prototype.compile error case (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | test/mjsunit/regexp-compile.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index d8fdafbd654ee9a8ce517e931d0ed75a88970cd1..9842fe90fd02d0fdd0881b465be9b21ade98c248 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -15425,6 +15425,9 @@ MaybeHandle<JSRegExp> JSRegExp::Initialize(Handle<JSRegExp> regexp,
ASSIGN_RETURN_ON_EXCEPTION(isolate, escaped_source,
EscapeRegExpSource(isolate, source), JSRegExp);
+ RETURN_ON_EXCEPTION(isolate, RegExpImpl::Compile(regexp, source, flags),
+ JSRegExp);
+
regexp->set_source(*escaped_source);
regexp->set_flags(Smi::FromInt(flags));
@@ -15445,9 +15448,6 @@ MaybeHandle<JSRegExp> JSRegExp::Initialize(Handle<JSRegExp> regexp,
.Check();
}
- RETURN_ON_EXCEPTION(isolate, RegExpImpl::Compile(regexp, source, flags),
- JSRegExp);
-
return regexp;
}
« no previous file with comments | « no previous file | test/mjsunit/regexp-compile.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698