Skip to content

Commit deb7ee9

Browse files
committed
deps: backport 7b24219346 from v8 upstream
Original: 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} PR-URL: #1805 Reviewed-By: Domenic Denicola <[email protected]>
1 parent 9bc2e26 commit deb7ee9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

deps/v8/src/api.cc

+5-6
Original file line numberDiff line numberDiff line change
@@ -4029,10 +4029,10 @@ MaybeLocal<Value> v8::Object::GetRealNamedPropertyInPrototypeChain(
40294029
auto proto = i::PrototypeIterator::GetCurrent(iter);
40304030
i::LookupIterator it(self, key_obj, i::Handle<i::JSReceiver>::cast(proto),
40314031
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
4032-
if (!it.IsFound()) return MaybeLocal<Value>();
40334032
Local<Value> result;
40344033
has_pending_exception = !ToLocal<Value>(i::Object::GetProperty(&it), &result);
40354034
RETURN_ON_FAILED_EXECUTION(Value);
4035+
if (!it.IsFound()) return MaybeLocal<Value>();
40364036
RETURN_ESCAPED(result);
40374037
}
40384038

@@ -4058,9 +4058,9 @@ v8::Object::GetRealNamedPropertyAttributesInPrototypeChain(
40584058
auto proto = i::PrototypeIterator::GetCurrent(iter);
40594059
i::LookupIterator it(self, key_obj, i::Handle<i::JSReceiver>::cast(proto),
40604060
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
4061-
if (!it.IsFound()) return Nothing<PropertyAttribute>();
40624061
auto result = i::JSReceiver::GetPropertyAttributes(&it);
40634062
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(PropertyAttribute);
4063+
if (!it.IsFound()) return Nothing<PropertyAttribute>();
40644064
if (result.FromJust() == ABSENT) {
40654065
return Just(static_cast<PropertyAttribute>(NONE));
40664066
}
@@ -4078,16 +4078,15 @@ v8::Object::GetRealNamedPropertyAttributesInPrototypeChain(Handle<String> key) {
40784078

40794079
MaybeLocal<Value> v8::Object::GetRealNamedProperty(Local<Context> context,
40804080
Local<Name> key) {
4081-
PREPARE_FOR_EXECUTION(
4082-
context, "v8::Object::GetRealNamedPropertyInPrototypeChain()", Value);
4081+
PREPARE_FOR_EXECUTION(context, "v8::Object::GetRealNamedProperty()", Value);
40834082
auto self = Utils::OpenHandle(this);
40844083
auto key_obj = Utils::OpenHandle(*key);
40854084
i::LookupIterator it(self, key_obj,
40864085
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
4087-
if (!it.IsFound()) return MaybeLocal<Value>();
40884086
Local<Value> result;
40894087
has_pending_exception = !ToLocal<Value>(i::Object::GetProperty(&it), &result);
40904088
RETURN_ON_FAILED_EXECUTION(Value);
4089+
if (!it.IsFound()) return MaybeLocal<Value>();
40914090
RETURN_ESCAPED(result);
40924091
}
40934092

@@ -4107,9 +4106,9 @@ Maybe<PropertyAttribute> v8::Object::GetRealNamedPropertyAttributes(
41074106
auto key_obj = Utils::OpenHandle(*key);
41084107
i::LookupIterator it(self, key_obj,
41094108
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
4110-
if (!it.IsFound()) return Nothing<PropertyAttribute>();
41114109
auto result = i::JSReceiver::GetPropertyAttributes(&it);
41124110
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(PropertyAttribute);
4111+
if (!it.IsFound()) return Nothing<PropertyAttribute>();
41134112
if (result.FromJust() == ABSENT) {
41144113
return Just(static_cast<PropertyAttribute>(NONE));
41154114
}

0 commit comments

Comments
 (0)