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

Unified Diff: src/objects.cc

Issue 17781002: Allow users of the V8 API to distinguish between unset and undefined HiddenValues (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 8633012ba1ee19d2dcf3281812aec031d0cc3b3b..5265901435a67a697244f6001b7e058ea8e73c3b 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -4734,7 +4734,7 @@ Object* JSObject::GetHiddenProperty(Name* key) {
// For a proxy, use the prototype as target object.
Object* proxy_parent = GetPrototype();
// If the proxy is detached, return undefined.
- if (proxy_parent->IsNull()) return GetHeap()->undefined_value();
+ if (proxy_parent->IsNull()) return GetHeap()->the_hole_value();
ASSERT(proxy_parent->IsJSGlobalObject());
return JSObject::cast(proxy_parent)->GetHiddenProperty(key);
}
@@ -4748,15 +4748,14 @@ Object* JSObject::GetHiddenProperty(Name* key) {
if (key == GetHeap()->identity_hash_string()) {
return inline_value;
} else {
- return GetHeap()->undefined_value();
+ return GetHeap()->the_hole_value();
}
}
- if (inline_value->IsUndefined()) return GetHeap()->undefined_value();
+ if (inline_value->IsUndefined()) return GetHeap()->the_hole_value();
ObjectHashTable* hashtable = ObjectHashTable::cast(inline_value);
Object* entry = hashtable->Lookup(key);
- if (entry->IsTheHole()) return GetHeap()->undefined_value();
return entry;
}
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698