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

Unified Diff: src/objects.cc

Issue 40324: Allow hidden properties and implement GetIdentityHash (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 9 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') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 1540)
+++ src/objects.cc (working copy)
@@ -5171,6 +5171,26 @@
}
+Object* JSObject::GetHiddenProperties(bool create_if_needed) {
+ String* key = Heap::hidden_symbol();
+ if (!this->HasProperty(key)) {
+ // Hidden properties object not found. Allocate a new hidden properties
+ // object if requested. Otherwise return the undefined value.
+ if (create_if_needed) {
+ Object* obj = Heap::AllocateJSObject(
+ Top::context()->global_context()->object_function());
+ if (obj->IsFailure()) {
+ return obj;
+ }
+ return this->SetProperty(key, obj, DONT_ENUM);
+ } else {
+ return Heap::undefined_value();
+ }
+ }
+ return this->GetProperty(key);
+}
+
+
bool JSObject::HasElementWithReceiver(JSObject* receiver, uint32_t index) {
// Check access rights if needed.
if (IsAccessCheckNeeded() &&
« no previous file with comments | « src/objects.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698