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

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

Cr-Commit-Position: refs/heads/master@{#31522}
This commit is contained in:
jkummerow 2015-10-23 06:22:19 -07:00 committed by Commit bot
parent e5ae33b55b
commit cbda86196b

View File

@ -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);