Browse Source

SetClassName on internal classes.

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
602f9dbf3f
  1. 1
      src/child_process.cc
  2. 2
      src/events.cc
  3. 2
      src/file.cc
  4. 3
      src/http.cc
  5. 2
      src/net.cc
  6. 1
      src/timer.cc

1
src/child_process.cc

@ -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);

2
src/events.cc

@ -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);

2
src/file.cc

@ -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());
}

3
src/http.cc

@ -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());
}

2
src/net.cc

@ -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);

1
src/timer.cc

@ -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);

Loading…
Cancel
Save