Revision: 5590
Author: [email protected]
Date: Tue Oct  5 05:48:32 2010
Log: Add a check that accessors set to instance template work even if we have a custom call handler.

Review URL: http://codereview.chromium.org/3526008
http://code.google.com/p/v8/source/detail?r=5590

Modified:
 /branches/bleeding_edge/test/cctest/test-api.cc

=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc     Tue Oct  5 04:51:41 2010
+++ /branches/bleeding_edge/test/cctest/test-api.cc     Tue Oct  5 05:48:32 2010
@@ -766,6 +766,12 @@
   return args.This();
 }

+static v8::Handle<Value> Return239(Local<String> name, const AccessorInfo&) {
+  ApiTestFuzzer::Fuzz();
+  return v8_num(239);
+}
+
+
 THREADED_TEST(FunctionTemplate) {
   v8::HandleScope scope;
   LocalContext env;
@@ -792,6 +798,7 @@
     Local<v8::FunctionTemplate> fun_templ =
         v8::FunctionTemplate::New(construct_call);
     fun_templ->SetClassName(v8_str("funky"));
+    fun_templ->InstanceTemplate()->SetAccessor(v8_str("m"), Return239);
     Local<Function> fun = fun_templ->GetFunction();
     env->Global()->Set(v8_str("obj"), fun);
     Local<Script> script = v8_compile("var s = new obj(); s.x");
@@ -799,6 +806,9 @@

     Local<Value> result = v8_compile("(new obj()).toString()")->Run();
     CHECK_EQ(v8_str("[object funky]"), result);
+
+    result = v8_compile("(new obj()).m")->Run();
+    CHECK_EQ(239, result->Int32Value());
   }
 }

@@ -6507,12 +6517,6 @@
     "result;",
     42 * 10);
 }
-
-
-static v8::Handle<Value> Return239(Local<String> name, const AccessorInfo&) {
-  ApiTestFuzzer::Fuzz();
-  return v8_num(239);
-}


 static void SetOnThis(Local<String> name,

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to