Skip to content

Commit 7b24219

Browse files
jeisingerCommit bot
authored andcommitted
Fix lookup iterator checks in GetRealNamedProperty* methods
BUG=v8:4143 [email protected] LOG=n Review URL: https://codereview.chromium.org/1161553004 Cr-Commit-Position: refs/heads/master@{#28616}
1 parent 32de677 commit 7b24219

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/api.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4033,10 +4033,10 @@ MaybeLocal<Value> v8::Object::GetRealNamedPropertyInPrototypeChain(
40334033
auto proto = i::PrototypeIterator::GetCurrent(iter);
40344034
i::LookupIterator it(self, key_obj, i::Handle<i::JSReceiver>::cast(proto),
40354035
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
4036-
if (!it.IsFound()) return MaybeLocal<Value>();
40374036
Local<Value> result;
40384037
has_pending_exception = !ToLocal<Value>(i::Object::GetProperty(&it), &result);
40394038
RETURN_ON_FAILED_EXECUTION(Value);
4039+
if (!it.IsFound()) return MaybeLocal<Value>();
40404040
RETURN_ESCAPED(result);
40414041
}
40424042

@@ -4062,9 +4062,9 @@ v8::Object::GetRealNamedPropertyAttributesInPrototypeChain(
40624062
auto proto = i::PrototypeIterator::GetCurrent(iter);
40634063
i::LookupIterator it(self, key_obj, i::Handle<i::JSReceiver>::cast(proto),
40644064
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
4065-
if (!it.IsFound()) return Nothing<PropertyAttribute>();
40664065
auto result = i::JSReceiver::GetPropertyAttributes(&it);
40674066
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(PropertyAttribute);
4067+
if (!it.IsFound()) return Nothing<PropertyAttribute>();
40684068
if (result.FromJust() == ABSENT) {
40694069
return Just(static_cast<PropertyAttribute>(NONE));
40704070
}
@@ -4082,16 +4082,15 @@ v8::Object::GetRealNamedPropertyAttributesInPrototypeChain(Handle<String> key) {
40824082

40834083
MaybeLocal<Value> v8::Object::GetRealNamedProperty(Local<Context> context,
40844084
Local<Name> key) {
4085-
PREPARE_FOR_EXECUTION(
4086-
context, "v8::Object::GetRealNamedPropertyInPrototypeChain()", Value);
4085+
PREPARE_FOR_EXECUTION(context, "v8::Object::GetRealNamedProperty()", Value);
40874086
auto self = Utils::OpenHandle(this);
40884087
auto key_obj = Utils::OpenHandle(*key);
40894088
i::LookupIterator it(self, key_obj,
40904089
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
4091-
if (!it.IsFound()) return MaybeLocal<Value>();
40924090
Local<Value> result;
40934091
has_pending_exception = !ToLocal<Value>(i::Object::GetProperty(&it), &result);
40944092
RETURN_ON_FAILED_EXECUTION(Value);
4093+
if (!it.IsFound()) return MaybeLocal<Value>();
40954094
RETURN_ESCAPED(result);
40964095
}
40974096

@@ -4111,9 +4110,9 @@ Maybe<PropertyAttribute> v8::Object::GetRealNamedPropertyAttributes(
41114110
auto key_obj = Utils::OpenHandle(*key);
41124111
i::LookupIterator it(self, key_obj,
41134112
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
4114-
if (!it.IsFound()) return Nothing<PropertyAttribute>();
41154113
auto result = i::JSReceiver::GetPropertyAttributes(&it);
41164114
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(PropertyAttribute);
4115+
if (!it.IsFound()) return Nothing<PropertyAttribute>();
41174116
if (result.FromJust() == ABSENT) {
41184117
return Just(static_cast<PropertyAttribute>(NONE));
41194118
}

0 commit comments

Comments
 (0)