Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 9fac06a9f2fb650671e2776e93e95e3036b4b2ab..22a659ae510c081e22f8b33edbd14b703028a950 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -896,13 +896,15 @@ Failure* Isolate::Throw(Object* exception, MessageLocation* location) { |
Failure* Isolate::ReThrow(MaybeObject* exception, MessageLocation* location) { |
bool can_be_caught_externally = false; |
- ShouldReportException(&can_be_caught_externally, |
- is_catchable_by_javascript(exception)); |
+ bool catchable_by_javascript = is_catchable_by_javascript(exception); |
+ ShouldReportException(&can_be_caught_externally, catchable_by_javascript); |
+ |
thread_local_top()->catcher_ = can_be_caught_externally ? |
try_catch_handler() : NULL; |
// Set the exception being re-thrown. |
set_pending_exception(exception); |
+ if (exception->IsFailure()) return exception->ToFailureUnchecked(); |
return Failure::Exception(); |
} |