Browse Source

Remove v8 prefix from function template callbacks.

v0.7.4-release
Ryan 16 years ago
parent
commit
9a63d8ec28
  1. 12
      src/http.cc
  2. 6
      src/http.h
  3. 40
      src/net.cc
  4. 20
      src/net.h

12
src/http.cc

@ -39,13 +39,13 @@ HTTPConnection::Initialize (Handle<Object> target)
{
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(v8NewClient);
Local<FunctionTemplate> t = FunctionTemplate::New(NewClient);
client_constructor_template = Persistent<FunctionTemplate>::New(t);
client_constructor_template->Inherit(Connection::constructor_template);
client_constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
target->Set(String::NewSymbol("LowLevelClient"), client_constructor_template->GetFunction());
t = FunctionTemplate::New(v8NewServer);
t = FunctionTemplate::New(NewServer);
server_constructor_template = Persistent<FunctionTemplate>::New(t);
server_constructor_template->Inherit(Connection::constructor_template);
server_constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
@ -54,7 +54,7 @@ HTTPConnection::Initialize (Handle<Object> target)
}
Handle<Value>
HTTPConnection::v8NewClient (const Arguments& args)
HTTPConnection::NewClient (const Arguments& args)
{
HandleScope scope;
@ -65,7 +65,7 @@ HTTPConnection::v8NewClient (const Arguments& args)
}
Handle<Value>
HTTPConnection::v8NewServer (const Arguments& args)
HTTPConnection::NewServer (const Arguments& args)
{
HandleScope scope;
@ -295,7 +295,7 @@ HTTPServer::Initialize (Handle<Object> target)
{
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(v8New);
Local<FunctionTemplate> t = FunctionTemplate::New(New);
constructor_template = Persistent<FunctionTemplate>::New(t);
constructor_template->Inherit(Acceptor::constructor_template);
constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
@ -303,7 +303,7 @@ HTTPServer::Initialize (Handle<Object> target)
}
Handle<Value>
HTTPServer::v8New (const Arguments& args)
HTTPServer::New (const Arguments& args)
{
HandleScope scope;

6
src/http.h

@ -15,8 +15,8 @@ public:
static v8::Persistent<v8::FunctionTemplate> server_constructor_template;
protected:
static v8::Handle<v8::Value> v8NewClient (const v8::Arguments& args);
static v8::Handle<v8::Value> v8NewServer (const v8::Arguments& args);
static v8::Handle<v8::Value> NewClient (const v8::Arguments& args);
static v8::Handle<v8::Value> NewServer (const v8::Arguments& args);
HTTPConnection (v8::Handle<v8::Object> handle,
enum http_parser_type type);
@ -43,7 +43,7 @@ public:
static v8::Persistent<v8::FunctionTemplate> constructor_template;
protected:
static v8::Handle<v8::Value> v8New (const v8::Arguments& args);
static v8::Handle<v8::Value> New (const v8::Arguments& args);
HTTPServer (v8::Handle<v8::Object> handle,

40
src/net.cc

@ -49,17 +49,17 @@ Connection::Initialize (v8::Handle<v8::Object> target)
{
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(v8New);
Local<FunctionTemplate> t = FunctionTemplate::New(New);
constructor_template = Persistent<FunctionTemplate>::New(t);
constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "connect", v8Connect);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "send", v8Send);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "sendUtf8", v8SendUtf8);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "close", v8Close);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "fullClose", v8FullClose);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "forceClose", v8ForceClose);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "connect", Connect);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "send", Send);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "sendUtf8", SendUtf8);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "close", Close);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "fullClose", FullClose);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "forceClose", ForceClose);
constructor_template->PrototypeTemplate()->SetAccessor(
String::NewSymbol("encoding"),
@ -143,7 +143,7 @@ Connection::SetAcceptor (Handle<Object> acceptor_handle)
}
Handle<Value>
Connection::v8New (const Arguments& args)
Connection::New (const Arguments& args)
{
HandleScope scope;
@ -154,7 +154,7 @@ Connection::v8New (const Arguments& args)
}
Handle<Value>
Connection::v8Connect (const Arguments& args)
Connection::Connect (const Arguments& args)
{
Connection *connection = NODE_UNWRAP(Connection, args.Holder());
if (!connection) return Handle<Value>();
@ -237,7 +237,7 @@ Connection::AfterResolve (eio_req *req)
}
Handle<Value>
Connection::v8Close (const Arguments& args)
Connection::Close (const Arguments& args)
{
HandleScope scope;
Connection *connection = NODE_UNWRAP(Connection, args.Holder());
@ -248,7 +248,7 @@ Connection::v8Close (const Arguments& args)
}
Handle<Value>
Connection::v8FullClose (const Arguments& args)
Connection::FullClose (const Arguments& args)
{
HandleScope scope;
Connection *connection = NODE_UNWRAP(Connection, args.Holder());
@ -259,7 +259,7 @@ Connection::v8FullClose (const Arguments& args)
}
Handle<Value>
Connection::v8ForceClose (const Arguments& args)
Connection::ForceClose (const Arguments& args)
{
HandleScope scope;
Connection *connection = NODE_UNWRAP(Connection, args.Holder());
@ -295,7 +295,7 @@ new_buf (size_t size)
}
Handle<Value>
Connection::v8SendUtf8 (const Arguments& args)
Connection::SendUtf8 (const Arguments& args)
{
HandleScope scope;
Connection *connection = NODE_UNWRAP(Connection, args.Holder());
@ -315,7 +315,7 @@ Connection::v8SendUtf8 (const Arguments& args)
}
Handle<Value>
Connection::v8Send (const Arguments& args)
Connection::Send (const Arguments& args)
{
HandleScope scope;
Connection *connection = NODE_UNWRAP(Connection, args.Holder());
@ -418,13 +418,13 @@ Acceptor::Initialize (Handle<Object> target)
{
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(v8New);
Local<FunctionTemplate> t = FunctionTemplate::New(New);
constructor_template = Persistent<FunctionTemplate>::New(t);
constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "listen", v8Listen);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "close", v8Close);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "listen", Listen);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "close", Close);
target->Set(String::NewSymbol("Server"), constructor_template->GetFunction());
}
@ -490,7 +490,7 @@ Acceptor::OnConnection (struct sockaddr *addr, socklen_t len)
}
Handle<Value>
Acceptor::v8New (const Arguments& args)
Acceptor::New (const Arguments& args)
{
HandleScope scope;
@ -513,7 +513,7 @@ Acceptor::v8New (const Arguments& args)
}
Handle<Value>
Acceptor::v8Listen (const Arguments& args)
Acceptor::Listen (const Arguments& args)
{
Acceptor *acceptor = NODE_UNWRAP(Acceptor, args.Holder());
if (!acceptor) return Handle<Value>();
@ -546,7 +546,7 @@ Acceptor::v8Listen (const Arguments& args)
}
Handle<Value>
Acceptor::v8Close (const Arguments& args)
Acceptor::Close (const Arguments& args)
{
Acceptor *acceptor = NODE_UNWRAP(Acceptor, args.Holder());
if (!acceptor) return Handle<Value>();

20
src/net.h

@ -18,13 +18,13 @@ public:
protected:
/* v8 interface */
static v8::Persistent<v8::FunctionTemplate> constructor_template;
static v8::Handle<v8::Value> v8New (const v8::Arguments& args);
static v8::Handle<v8::Value> v8Connect (const v8::Arguments& args);
static v8::Handle<v8::Value> v8Send (const v8::Arguments& args);
static v8::Handle<v8::Value> v8SendUtf8 (const v8::Arguments& args);
static v8::Handle<v8::Value> v8Close (const v8::Arguments& args);
static v8::Handle<v8::Value> v8FullClose (const v8::Arguments& args);
static v8::Handle<v8::Value> v8ForceClose (const v8::Arguments& args);
static v8::Handle<v8::Value> New (const v8::Arguments& args);
static v8::Handle<v8::Value> Connect (const v8::Arguments& args);
static v8::Handle<v8::Value> Send (const v8::Arguments& args);
static v8::Handle<v8::Value> SendUtf8 (const v8::Arguments& args);
static v8::Handle<v8::Value> Close (const v8::Arguments& args);
static v8::Handle<v8::Value> FullClose (const v8::Arguments& args);
static v8::Handle<v8::Value> ForceClose (const v8::Arguments& args);
static v8::Handle<v8::Value> EncodingGetter (v8::Local<v8::String> _, const v8::AccessorInfo& info);
static void EncodingSetter (v8::Local<v8::String> _, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
@ -107,9 +107,9 @@ public:
protected:
static v8::Persistent<v8::FunctionTemplate> constructor_template;
static v8::Handle<v8::Value> v8New (const v8::Arguments& args);
static v8::Handle<v8::Value> v8Listen (const v8::Arguments& args);
static v8::Handle<v8::Value> v8Close (const v8::Arguments& args);
static v8::Handle<v8::Value> New (const v8::Arguments& args);
static v8::Handle<v8::Value> Listen (const v8::Arguments& args);
static v8::Handle<v8::Value> Close (const v8::Arguments& args);
Acceptor (v8::Handle<v8::Object> handle,
v8::Handle<v8::Function> connection_handler,

Loading…
Cancel
Save