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; |
} |