Commit cbda8619 authored by jkummerow's avatar jkummerow Committed by Commit bot

GetOwnPropertyDescriptor: API-style accessors can throw, check for that.

Review URL: https://codereview.chromium.org/1412823003

Cr-Commit-Position: refs/heads/master@{#31522}
parent e5ae33b5
...@@ -6617,7 +6617,11 @@ bool JSReceiver::GetOwnPropertyDescriptor(LookupIterator* it, ...@@ -6617,7 +6617,11 @@ bool JSReceiver::GetOwnPropertyDescriptor(LookupIterator* it,
it->GetAccessors()->IsAccessorPair(); it->GetAccessors()->IsAccessorPair();
if (!is_accessor_pair) { if (!is_accessor_pair) {
// 5a. Set D.[[Value]] to the value of X's [[Value]] attribute. // 5a. Set D.[[Value]] to the value of X's [[Value]] attribute.
Handle<Object> value = JSObject::GetProperty(it).ToHandleChecked(); Handle<Object> value;
if (!JSObject::GetProperty(it).ToHandle(&value)) {
DCHECK(isolate->has_pending_exception());
return false;
}
desc->set_value(value); desc->set_value(value);
// 5b. Set D.[[Writable]] to the value of X's [[Writable]] attribute // 5b. Set D.[[Writable]] to the value of X's [[Writable]] attribute
desc->set_writable((attrs & READ_ONLY) == 0); desc->set_writable((attrs & READ_ONLY) == 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment