Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 4f5efea8b4883cd405b5141b43a0f141f92f4a83..61339781214bb92efe0d3ff6143a708b7396f4ca 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -6404,6 +6404,24 @@ THREADED_TEST(ObjectInstantiation) { |
} |
+THREADED_TEST(ObjectPropertyCache) { |
+ v8::HandleScope scope(v8::Isolate::GetCurrent()); |
+ const char* extension_list[] = { "v8/gc" }; |
+ v8::ExtensionConfiguration extensions(1, extension_list); |
+ LocalContext context(&extensions); |
+ |
+ v8::Handle<v8::Object> obj = v8::Object::New(); |
+ Handle<String> symbol = String::NewSymbol("key"); |
+ Handle<v8::Number> num = v8::Number::New(42); |
+ static v8::Object::CachedProperty property(symbol); |
+ for (int i = 0; i < 100; i++) { |
+ obj->Set(property, num); |
+ CHECK_EQ(obj->Get(property)->Int32Value(), 42); |
+ if (i % 10 == 0) v8_compile("gc();")->Run(); |
+ } |
+} |
+ |
+ |
static int StrCmp16(uint16_t* a, uint16_t* b) { |
while (true) { |
if (*a == 0 && *b == 0) return 0; |