Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: src/api.cc

Issue 494583003: Return empty handle if GetPropertyByLookup has no result. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 69a5062965dd76e3c5c8e6e1b876a965df1e54e7..79cf36c794b793023ca8cd13ae7242879e1bff02 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698