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 <domenic@domenicdenicola.com>
This commit is contained in:
parent
9bc2e26720
commit
deb7ee93a7
11
deps/v8/src/api.cc
vendored
11
deps/v8/src/api.cc
vendored
@ -4029,10 +4029,10 @@ MaybeLocal<Value> v8::Object::GetRealNamedPropertyInPrototypeChain(
|
|||||||
auto proto = i::PrototypeIterator::GetCurrent(iter);
|
auto proto = i::PrototypeIterator::GetCurrent(iter);
|
||||||
i::LookupIterator it(self, key_obj, i::Handle<i::JSReceiver>::cast(proto),
|
i::LookupIterator it(self, key_obj, i::Handle<i::JSReceiver>::cast(proto),
|
||||||
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
|
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
|
||||||
if (!it.IsFound()) return MaybeLocal<Value>();
|
|
||||||
Local<Value> result;
|
Local<Value> result;
|
||||||
has_pending_exception = !ToLocal<Value>(i::Object::GetProperty(&it), &result);
|
has_pending_exception = !ToLocal<Value>(i::Object::GetProperty(&it), &result);
|
||||||
RETURN_ON_FAILED_EXECUTION(Value);
|
RETURN_ON_FAILED_EXECUTION(Value);
|
||||||
|
if (!it.IsFound()) return MaybeLocal<Value>();
|
||||||
RETURN_ESCAPED(result);
|
RETURN_ESCAPED(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4058,9 +4058,9 @@ v8::Object::GetRealNamedPropertyAttributesInPrototypeChain(
|
|||||||
auto proto = i::PrototypeIterator::GetCurrent(iter);
|
auto proto = i::PrototypeIterator::GetCurrent(iter);
|
||||||
i::LookupIterator it(self, key_obj, i::Handle<i::JSReceiver>::cast(proto),
|
i::LookupIterator it(self, key_obj, i::Handle<i::JSReceiver>::cast(proto),
|
||||||
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
|
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
|
||||||
if (!it.IsFound()) return Nothing<PropertyAttribute>();
|
|
||||||
auto result = i::JSReceiver::GetPropertyAttributes(&it);
|
auto result = i::JSReceiver::GetPropertyAttributes(&it);
|
||||||
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(PropertyAttribute);
|
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(PropertyAttribute);
|
||||||
|
if (!it.IsFound()) return Nothing<PropertyAttribute>();
|
||||||
if (result.FromJust() == ABSENT) {
|
if (result.FromJust() == ABSENT) {
|
||||||
return Just(static_cast<PropertyAttribute>(NONE));
|
return Just(static_cast<PropertyAttribute>(NONE));
|
||||||
}
|
}
|
||||||
@ -4078,16 +4078,15 @@ v8::Object::GetRealNamedPropertyAttributesInPrototypeChain(Handle<String> key) {
|
|||||||
|
|
||||||
MaybeLocal<Value> v8::Object::GetRealNamedProperty(Local<Context> context,
|
MaybeLocal<Value> v8::Object::GetRealNamedProperty(Local<Context> context,
|
||||||
Local<Name> key) {
|
Local<Name> key) {
|
||||||
PREPARE_FOR_EXECUTION(
|
PREPARE_FOR_EXECUTION(context, "v8::Object::GetRealNamedProperty()", Value);
|
||||||
context, "v8::Object::GetRealNamedPropertyInPrototypeChain()", Value);
|
|
||||||
auto self = Utils::OpenHandle(this);
|
auto self = Utils::OpenHandle(this);
|
||||||
auto key_obj = Utils::OpenHandle(*key);
|
auto key_obj = Utils::OpenHandle(*key);
|
||||||
i::LookupIterator it(self, key_obj,
|
i::LookupIterator it(self, key_obj,
|
||||||
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
|
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
|
||||||
if (!it.IsFound()) return MaybeLocal<Value>();
|
|
||||||
Local<Value> result;
|
Local<Value> result;
|
||||||
has_pending_exception = !ToLocal<Value>(i::Object::GetProperty(&it), &result);
|
has_pending_exception = !ToLocal<Value>(i::Object::GetProperty(&it), &result);
|
||||||
RETURN_ON_FAILED_EXECUTION(Value);
|
RETURN_ON_FAILED_EXECUTION(Value);
|
||||||
|
if (!it.IsFound()) return MaybeLocal<Value>();
|
||||||
RETURN_ESCAPED(result);
|
RETURN_ESCAPED(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4107,9 +4106,9 @@ Maybe<PropertyAttribute> v8::Object::GetRealNamedPropertyAttributes(
|
|||||||
auto key_obj = Utils::OpenHandle(*key);
|
auto key_obj = Utils::OpenHandle(*key);
|
||||||
i::LookupIterator it(self, key_obj,
|
i::LookupIterator it(self, key_obj,
|
||||||
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
|
i::LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
|
||||||
if (!it.IsFound()) return Nothing<PropertyAttribute>();
|
|
||||||
auto result = i::JSReceiver::GetPropertyAttributes(&it);
|
auto result = i::JSReceiver::GetPropertyAttributes(&it);
|
||||||
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(PropertyAttribute);
|
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(PropertyAttribute);
|
||||||
|
if (!it.IsFound()) return Nothing<PropertyAttribute>();
|
||||||
if (result.FromJust() == ABSENT) {
|
if (result.FromJust() == ABSENT) {
|
||||||
return Just(static_cast<PropertyAttribute>(NONE));
|
return Just(static_cast<PropertyAttribute>(NONE));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user