static Handle<String> name() { return Handle<String>(&Heap::name##_); }
SYMBOL_LIST(SYMBOL_ACCESSOR)
#undef SYMBOL_ACCESSOR
-
+
static Handle<String> hidden_symbol() {
return Handle<String>(&Heap::hidden_symbol_);
}
(name##_) = String::cast(obj);
SYMBOL_LIST(SYMBOL_INITIALIZE)
#undef SYMBOL_INITIALIZE
-
+
// Allocate the hidden symbol which is used to identify the hidden properties
// in JSObjects. The hash code has a special value so that it will not match
// the empty string when searching for the property. It cannot be part of the
#define SYMBOL_ACCESSOR(name, str) static String* name() { return name##_; }
SYMBOL_LIST(SYMBOL_ACCESSOR)
#undef SYMBOL_ACCESSOR
-
+
// The hidden_symbol is special because it is the empty string, but does
// not match the empty string.
static String* hidden_symbol() { return hidden_symbol_; }
#define SYMBOL_DECLARATION(name, str) static String* name##_;
SYMBOL_LIST(SYMBOL_DECLARATION)
#undef SYMBOL_DECLARATION
-
+
// The special hidden symbol which is an empty string, but does not match
// any string when looked up in properties.
static String* hidden_symbol_;
#ifdef DEBUG
PropertyDetails details(descriptors->GetDetails(0));
ASSERT(details.type() == FIELD);
-#endif // DEBUG
+#endif // DEBUG
Object* value = descriptors->GetValue(0);
return FastPropertyAt(Descriptor::IndexFromValue(value));
}
v8::Local<v8::String> key = v8_str("api-test::hidden-key");
v8::Local<v8::String> empty = v8_str("");
v8::Local<v8::String> prop_name = v8_str("prop_name");
-
+
i::Heap::CollectAllGarbage();
CHECK(obj->SetHiddenValue(key, v8::Integer::New(1503)));
CHECK_EQ(1503, obj->GetHiddenValue(key)->Int32Value());
CHECK(obj->SetHiddenValue(key, v8::Integer::New(2002)));
CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value());
-
+
i::Heap::CollectAllGarbage();
// Make sure we do not find the hidden property.
CHECK(obj->Set(empty, v8::Integer::New(2003)));
CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value());
CHECK_EQ(2003, obj->Get(empty)->Int32Value());
-
+
i::Heap::CollectAllGarbage();
// Add another property and delete it afterwards to force the object in
CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value());
CHECK(obj->Delete(prop_name));
CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value());
-
+
i::Heap::CollectAllGarbage();
CHECK(obj->DeleteHiddenValue(key));