SetClassName on internal classes.
authorRyan Dahl <ry@tinyclouds.org>
Sat, 3 Oct 2009 13:08:03 +0000 (15:08 +0200)
committerRyan Dahl <ry@tinyclouds.org>
Sat, 3 Oct 2009 13:08:03 +0000 (15:08 +0200)
src/child_process.cc
src/events.cc
src/file.cc
src/http.cc
src/net.cc
src/timer.cc

index 0935c4e..74b1b7a 100644 (file)
@@ -23,6 +23,7 @@ void ChildProcess::Initialize(Handle<Object> target) {
   constructor_template = Persistent<FunctionTemplate>::New(t);
   constructor_template->Inherit(EventEmitter::constructor_template);
   constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
+  constructor_template->SetClassName(String::NewSymbol("ChildProcess"));
 
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "spawn", ChildProcess::Spawn);
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "write", ChildProcess::Write);
index 387f8ca..12d3182 100644 (file)
@@ -38,6 +38,7 @@ void EventEmitter::Initialize(Local<FunctionTemplate> ctemplate) {
   Local<FunctionTemplate> __emit = FunctionTemplate::New(Emit);
   constructor_template->PrototypeTemplate()->Set(String::NewSymbol("emit"),
       __emit);
+  constructor_template->SetClassName(String::NewSymbol("EventEmitter"));
 
   // All other prototype methods are defined in events.js
 
@@ -116,6 +117,7 @@ void Promise::Initialize(v8::Handle<v8::Object> target) {
   constructor_template = Persistent<FunctionTemplate>::New(t);
   constructor_template->Inherit(EventEmitter::constructor_template);
   constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
+  constructor_template->SetClassName(String::NewSymbol("Promise"));
 
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "block", Block);
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "emitSuccess", EmitSuccess);
index 3ff5a98..5ca3b86 100644 (file)
@@ -382,6 +382,8 @@ void File::Initialize(Handle<Object> target) {
       Promise::constructor_template);
   EIOPromise::constructor_template->InstanceTemplate()->
     SetInternalFieldCount(1);
+  EIOPromise::constructor_template->SetClassName(
+      String::NewSymbol("EIOPromise"));
   target->Set(String::NewSymbol("EIOPromise"),
       EIOPromise::constructor_template->GetFunction());
 }
index 294377e..1d2d2b4 100644 (file)
@@ -26,12 +26,14 @@ HTTPConnection::Initialize (Handle<Object> target)
   client_constructor_template = Persistent<FunctionTemplate>::New(t);
   client_constructor_template->Inherit(Connection::constructor_template);
   client_constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
+  client_constructor_template->SetClassName(String::NewSymbol("Client"));
   target->Set(String::NewSymbol("Client"), client_constructor_template->GetFunction());
 
   t = FunctionTemplate::New(NewServer);
   server_constructor_template = Persistent<FunctionTemplate>::New(t);
   server_constructor_template->Inherit(Connection::constructor_template);
   server_constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
+  server_constructor_template->SetClassName(String::NewSymbol("ServerSideConnection"));
 }
 
 Handle<Value>
@@ -206,6 +208,7 @@ HTTPServer::Initialize (Handle<Object> target)
   constructor_template = Persistent<FunctionTemplate>::New(t);
   constructor_template->Inherit(Server::constructor_template);
   constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
+  constructor_template->SetClassName(String::NewSymbol("Server"));
   target->Set(String::NewSymbol("Server"), constructor_template->GetFunction());
 }
 
index d1d449f..cc59387 100644 (file)
@@ -55,6 +55,7 @@ void Connection::Initialize(v8::Handle<v8::Object> target) {
   constructor_template = Persistent<FunctionTemplate>::New(t);
   constructor_template->Inherit(EventEmitter::constructor_template);
   constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
+  constructor_template->SetClassName(String::NewSymbol("Connection"));
 
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "connect", Connect);
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "send", Send);
@@ -422,6 +423,7 @@ void Server::Initialize(Handle<Object> target) {
   constructor_template = Persistent<FunctionTemplate>::New(t);
   constructor_template->Inherit(EventEmitter::constructor_template);
   constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
+  constructor_template->SetClassName(String::NewSymbol("Server"));
 
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "listen", Listen);
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "close", Close);
index e24a52a..61f18f7 100644 (file)
@@ -18,6 +18,7 @@ Timer::Initialize (Handle<Object> target)
   constructor_template = Persistent<FunctionTemplate>::New(t);
   constructor_template->Inherit(EventEmitter::constructor_template);
   constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
+  constructor_template->SetClassName(String::NewSymbol("Timer"));
 
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "start", Timer::Start);
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "stop", Timer::Stop);