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

Unified Diff: src/jsregexp.cc

Issue 516913003: Do not expose termination exceptions to the Exception API. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comment Created 6 years, 4 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 | « src/json-stringifier.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jsregexp.cc
diff --git a/src/jsregexp.cc b/src/jsregexp.cc
index 3853197e138133a75b11cf658f7f40aef92dc94b..7891cd8744bbba2fe168f2b78f739632e5248f24 100644
--- a/src/jsregexp.cc
+++ b/src/jsregexp.cc
@@ -88,8 +88,8 @@ static inline MaybeHandle<Object> ThrowRegExpException(
elements->set(0, *pattern);
elements->set(1, *error_text);
Handle<JSArray> array = factory->NewJSArrayWithElements(elements);
- Handle<Object> regexp_err = factory->NewSyntaxError(message, array);
- return isolate->Throw<Object>(regexp_err);
+ Handle<Object> regexp_err;
+ THROW_NEW_ERROR(isolate, NewSyntaxError(message, array), Object);
}
@@ -372,8 +372,7 @@ bool RegExpImpl::EnsureCompiledIrregexp(
}
-static bool CreateRegExpErrorObjectAndThrow(Handle<JSRegExp> re,
- bool is_ascii,
+static void CreateRegExpErrorObjectAndThrow(Handle<JSRegExp> re, bool is_ascii,
Handle<String> error_message,
Isolate* isolate) {
Factory* factory = isolate->factory();
@@ -381,10 +380,10 @@ static bool CreateRegExpErrorObjectAndThrow(Handle<JSRegExp> re,
elements->set(0, re->Pattern());
elements->set(1, *error_message);
Handle<JSArray> array = factory->NewJSArrayWithElements(elements);
- Handle<Object> regexp_err =
+ Handle<Object> error;
+ MaybeHandle<Object> maybe_error =
factory->NewSyntaxError("malformed_regexp", array);
- isolate->Throw(*regexp_err);
- return false;
+ if (maybe_error.ToHandle(&error)) isolate->Throw(*error);
}
« no previous file with comments | « src/json-stringifier.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698