Return empty handle if GetPropertyByLookup has no result.

BUG=
R=yangguo@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23235 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
verwaest@chromium.org 2014-08-20 13:52:49 +00:00
parent f498fa5859
commit 4acf44d759

View File

@ -3571,7 +3571,8 @@ static Local<Value> GetPropertyByLookup(i::LookupIterator* it) {
has_pending_exception = !i::Object::GetProperty(it).ToHandle(&result);
EXCEPTION_BAILOUT_CHECK(it->isolate(), Local<Value>());
return Utils::ToLocal(result);
if (it->IsFound()) return Utils::ToLocal(result);
return Local<Value>();
}
@ -3599,8 +3600,7 @@ Local<Value> v8::Object::GetRealNamedProperty(Handle<String> key) {
ENTER_V8(isolate);
i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this);
i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
i::LookupIterator it(self_obj, key_obj,
i::LookupIterator::CHECK_DERIVED_PROPERTY);
i::LookupIterator it(self_obj, key_obj, i::LookupIterator::CHECK_PROPERTY);
return GetPropertyByLookup(&it);
}