Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 61e565f97b7a5dfd2aa910ebfe9398cd752b6b22..4ab786dd0c1d86d7dc54b962f976a442a4d3b009 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -1943,15 +1943,17 @@ v8::Local<Value> v8::TryCatch::StackTrace() const { |
i::HandleScope scope(isolate_); |
i::Handle<i::JSObject> obj(i::JSObject::cast(raw_obj), isolate_); |
i::Handle<i::String> name = isolate_->factory()->stack_string(); |
+ { |
+ EXCEPTION_PREAMBLE(isolate_); |
+ Maybe<bool> maybe = i::JSReceiver::HasProperty(obj, name); |
+ has_pending_exception = !maybe.has_value; |
+ EXCEPTION_BAILOUT_CHECK(isolate_, v8::Local<Value>()); |
+ if (!maybe.value) return v8::Local<Value>(); |
+ } |
+ i::Handle<i::Object> value; |
EXCEPTION_PREAMBLE(isolate_); |
- Maybe<bool> maybe = i::JSReceiver::HasProperty(obj, name); |
- has_pending_exception = !maybe.has_value; |
+ has_pending_exception = !i::Object::GetProperty(obj, name).ToHandle(&value); |
EXCEPTION_BAILOUT_CHECK(isolate_, v8::Local<Value>()); |
- if (!maybe.value) return v8::Local<Value>(); |
- i::Handle<i::Object> value; |
- if (!i::Object::GetProperty(obj, name).ToHandle(&value)) { |
- return v8::Local<Value>(); |
- } |
return v8::Utils::ToLocal(scope.CloseAndEscape(value)); |
} else { |
return v8::Local<Value>(); |