From 8335ece6d82fd255f4fd9418ea12358b2c4b7fb9 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Wed, 27 May 2015 10:34:17 +1000 Subject: [PATCH] deps: backport 7b24219346 from v8 upstream Original: Fix lookup iterator checks in GetRealNamedProperty* methods BUG=v8:4143 R=verwaest@chromium.org LOG=n Review URL: https://codereview.chromium.org/1161553004 Cr-Commit-Position: refs/heads/master@{#28616} PR-URL: https://github.com/nodejs/io.js/pull/1805 Reviewed-By: Domenic Denicola --- deps/v8/src/api.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index 049c35a9034911..c9c0f3ad85284e 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -4029,10 +4029,10 @@ MaybeLocal v8::Object::GetRealNamedPropertyInPrototypeChain( auto proto = i::PrototypeIterator::GetCurrent(iter); i::LookupIterator it(self, key_obj, i::Handle::cast(proto), i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); - if (!it.IsFound()) return MaybeLocal(); Local result; has_pending_exception = !ToLocal(i::Object::GetProperty(&it), &result); RETURN_ON_FAILED_EXECUTION(Value); + if (!it.IsFound()) return MaybeLocal(); RETURN_ESCAPED(result); } @@ -4058,9 +4058,9 @@ v8::Object::GetRealNamedPropertyAttributesInPrototypeChain( auto proto = i::PrototypeIterator::GetCurrent(iter); i::LookupIterator it(self, key_obj, i::Handle::cast(proto), i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); - if (!it.IsFound()) return Nothing(); auto result = i::JSReceiver::GetPropertyAttributes(&it); RETURN_ON_FAILED_EXECUTION_PRIMITIVE(PropertyAttribute); + if (!it.IsFound()) return Nothing(); if (result.FromJust() == ABSENT) { return Just(static_cast(NONE)); } @@ -4078,16 +4078,15 @@ v8::Object::GetRealNamedPropertyAttributesInPrototypeChain(Handle key) { MaybeLocal v8::Object::GetRealNamedProperty(Local context, Local key) { - PREPARE_FOR_EXECUTION( - context, "v8::Object::GetRealNamedPropertyInPrototypeChain()", Value); + PREPARE_FOR_EXECUTION(context, "v8::Object::GetRealNamedProperty()", Value); auto self = Utils::OpenHandle(this); auto key_obj = Utils::OpenHandle(*key); i::LookupIterator it(self, key_obj, i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); - if (!it.IsFound()) return MaybeLocal(); Local result; has_pending_exception = !ToLocal(i::Object::GetProperty(&it), &result); RETURN_ON_FAILED_EXECUTION(Value); + if (!it.IsFound()) return MaybeLocal(); RETURN_ESCAPED(result); } @@ -4107,9 +4106,9 @@ Maybe v8::Object::GetRealNamedPropertyAttributes( auto key_obj = Utils::OpenHandle(*key); i::LookupIterator it(self, key_obj, i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); - if (!it.IsFound()) return Nothing(); auto result = i::JSReceiver::GetPropertyAttributes(&it); RETURN_ON_FAILED_EXECUTION_PRIMITIVE(PropertyAttribute); + if (!it.IsFound()) return Nothing(); if (result.FromJust() == ABSENT) { return Just(static_cast(NONE)); }