From: Ryan Dahl Date: Sat, 3 Oct 2009 13:08:03 +0000 (+0200) Subject: SetClassName on internal classes. X-Git-Tag: v0.1.14~51 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=602f9dbf3fb8da6af3339a27feb356ec286bd9fa;p=platform%2Fupstream%2Fnodejs.git SetClassName on internal classes. --- diff --git a/src/child_process.cc b/src/child_process.cc index 0935c4e..74b1b7a 100644 --- a/src/child_process.cc +++ b/src/child_process.cc @@ -23,6 +23,7 @@ void ChildProcess::Initialize(Handle target) { constructor_template = Persistent::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); diff --git a/src/events.cc b/src/events.cc index 387f8ca..12d3182 100644 --- a/src/events.cc +++ b/src/events.cc @@ -38,6 +38,7 @@ void EventEmitter::Initialize(Local ctemplate) { Local __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 target) { constructor_template = Persistent::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); diff --git a/src/file.cc b/src/file.cc index 3ff5a98..5ca3b86 100644 --- a/src/file.cc +++ b/src/file.cc @@ -382,6 +382,8 @@ void File::Initialize(Handle 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()); } diff --git a/src/http.cc b/src/http.cc index 294377e..1d2d2b4 100644 --- a/src/http.cc +++ b/src/http.cc @@ -26,12 +26,14 @@ HTTPConnection::Initialize (Handle target) client_constructor_template = Persistent::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::New(t); server_constructor_template->Inherit(Connection::constructor_template); server_constructor_template->InstanceTemplate()->SetInternalFieldCount(1); + server_constructor_template->SetClassName(String::NewSymbol("ServerSideConnection")); } Handle @@ -206,6 +208,7 @@ HTTPServer::Initialize (Handle target) constructor_template = Persistent::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()); } diff --git a/src/net.cc b/src/net.cc index d1d449f..cc59387 100644 --- a/src/net.cc +++ b/src/net.cc @@ -55,6 +55,7 @@ void Connection::Initialize(v8::Handle target) { constructor_template = Persistent::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 target) { constructor_template = Persistent::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); diff --git a/src/timer.cc b/src/timer.cc index e24a52a..61f18f7 100644 --- a/src/timer.cc +++ b/src/timer.cc @@ -18,6 +18,7 @@ Timer::Initialize (Handle target) constructor_template = Persistent::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);