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

Unified Diff: src/api.cc

Issue 793333003: Correct handling of exceptions occured during getting of exception stack trace. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: offline comments addressed Created 5 years, 11 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/regress/regress-444805.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>();
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-444805.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698