Index: test/cctest/test-api.cc |
=================================================================== |
--- test/cctest/test-api.cc (revision 5888) |
+++ test/cctest/test-api.cc (working copy) |
@@ -7819,6 +7819,31 @@ |
} |
+THREADED_TEST(ObjectGetConstructorName) { |
+ v8::HandleScope scope; |
+ LocalContext context; |
+ v8_compile("function Parent() {};" |
+ "function Child() {};" |
+ "Child.prototype = new Parent();" |
+ "var outer = { inner: function() { } };" |
+ "var p = new Parent();" |
+ "var c = new Child();" |
+ "var x = new outer.inner();")->Run(); |
+ |
+ Local<v8::Value> p = context->Global()->Get(v8_str("p")); |
+ CHECK(p->IsObject() && p->ToObject()->GetConstructorName()->Equals( |
+ v8_str("Parent"))); |
+ |
+ Local<v8::Value> c = context->Global()->Get(v8_str("c")); |
+ CHECK(c->IsObject() && c->ToObject()->GetConstructorName()->Equals( |
+ v8_str("Child"))); |
+ |
+ Local<v8::Value> x = context->Global()->Get(v8_str("x")); |
+ CHECK(x->IsObject() && x->ToObject()->GetConstructorName()->Equals( |
+ v8_str("outer.inner"))); |
+} |
+ |
+ |
bool ApiTestFuzzer::fuzzing_ = false; |
i::Semaphore* ApiTestFuzzer::all_tests_done_= |
i::OS::CreateSemaphore(0); |