Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 12f481019b05cfe2d87693b15354ac9f2514d519..2910cfcd959426e724fcd44d2f905c3aec8a74d3 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -1782,17 +1782,22 @@ THREADED_TEST(GlobalPrototype) { |
THREADED_TEST(ObjectTemplate) { |
v8::Isolate* isolate = CcTest::isolate(); |
v8::HandleScope scope(isolate); |
- Local<ObjectTemplate> templ1 = ObjectTemplate::New(isolate); |
+ Local<v8::FunctionTemplate> fun = v8::FunctionTemplate::New(isolate); |
+ v8::Local<v8::String> class_name = |
+ v8::String::NewFromUtf8(isolate, "the_class_name"); |
+ fun->SetClassName(class_name); |
+ Local<ObjectTemplate> templ1 = ObjectTemplate::New(isolate, fun); |
templ1->Set(isolate, "x", v8_num(10)); |
templ1->Set(isolate, "y", v8_num(13)); |
LocalContext env; |
Local<v8::Object> instance1 = templ1->NewInstance(); |
+ CHECK(class_name->StrictEquals(instance1->GetConstructorName())); |
env->Global()->Set(v8_str("p"), instance1); |
CHECK(v8_compile("(p.x == 10)")->Run()->BooleanValue()); |
CHECK(v8_compile("(p.y == 13)")->Run()->BooleanValue()); |
- Local<v8::FunctionTemplate> fun = v8::FunctionTemplate::New(isolate); |
- fun->PrototypeTemplate()->Set(isolate, "nirk", v8_num(123)); |
- Local<ObjectTemplate> templ2 = fun->InstanceTemplate(); |
+ Local<v8::FunctionTemplate> fun2 = v8::FunctionTemplate::New(isolate); |
+ fun2->PrototypeTemplate()->Set(isolate, "nirk", v8_num(123)); |
+ Local<ObjectTemplate> templ2 = fun2->InstanceTemplate(); |
templ2->Set(isolate, "a", v8_num(12)); |
templ2->Set(isolate, "b", templ1); |
Local<v8::Object> instance2 = templ2->NewInstance(); |