Browse Source

Rename fatal_exception to FatalException

v0.7.4-release
Ryan 16 years ago
parent
commit
3bdd042a6e
  1. 2
      src/file.cc
  2. 14
      src/http.cc
  3. 8
      src/net.cc
  4. 2
      src/node.cc
  5. 2
      src/node.h
  6. 2
      src/timer.cc

2
src/file.cc

@ -45,7 +45,7 @@ do { \
TryCatch try_catch; \ TryCatch try_catch; \
(*callback)->Call(Context::GetCurrent()->Global(), argc, argv); \ (*callback)->Call(Context::GetCurrent()->Global(), argc, argv); \
if(try_catch.HasCaught()) \ if(try_catch.HasCaught()) \
node::fatal_exception(try_catch); \ node::FatalException(try_catch); \
free(callback); \ free(callback); \
} \ } \
} while(0) } while(0)

14
src/http.cc

@ -98,7 +98,7 @@ HTTPConnection::on_message_begin (http_parser *parser)
TryCatch try_catch; TryCatch try_catch;
Local<Object> message_handler = on_message->NewInstance(); Local<Object> message_handler = on_message->NewInstance();
if (try_catch.HasCaught()) { if (try_catch.HasCaught()) {
fatal_exception(try_catch); FatalException(try_catch);
return -1; return -1;
} }
@ -125,7 +125,7 @@ HTTPConnection::name (http_parser *parser, const char *buf, size_t len) \
Local<Value> argv[1] = { String::New(buf, len) }; \ Local<Value> argv[1] = { String::New(buf, len) }; \
Local<Value> ret = callback->Call(message_handler, 1, argv); \ Local<Value> ret = callback->Call(message_handler, 1, argv); \
if (ret.IsEmpty()) { \ if (ret.IsEmpty()) { \
fatal_exception(try_catch); \ FatalException(try_catch); \
return -2; \ return -2; \
} \ } \
if (ret->IsFalse()) return -3; \ if (ret->IsFalse()) return -3; \
@ -201,7 +201,7 @@ HTTPConnection::on_headers_complete (http_parser *parser)
TryCatch try_catch; TryCatch try_catch;
Local<Value> ret = on_headers_complete->Call(message_handler, 0, NULL); Local<Value> ret = on_headers_complete->Call(message_handler, 0, NULL);
if (ret.IsEmpty()) { if (ret.IsEmpty()) {
fatal_exception(try_catch); FatalException(try_catch);
return -2; return -2;
} }
if (ret->IsFalse()) return -3; if (ret->IsFalse()) return -3;
@ -246,7 +246,7 @@ HTTPConnection::on_body (http_parser *parser, const char *buf, size_t len)
TryCatch try_catch; TryCatch try_catch;
Local<Value> ret = on_body->Call(message_handler, 1, argv); Local<Value> ret = on_body->Call(message_handler, 1, argv);
if (ret.IsEmpty()) { if (ret.IsEmpty()) {
fatal_exception(try_catch); FatalException(try_catch);
return -2; return -2;
} }
if (ret->IsFalse()) return -3; if (ret->IsFalse()) return -3;
@ -273,7 +273,7 @@ HTTPConnection::on_message_complete (http_parser *parser)
TryCatch try_catch; TryCatch try_catch;
Local<Value> ret = on_msg_complete->Call(message_handler, 0, NULL); Local<Value> ret = on_msg_complete->Call(message_handler, 0, NULL);
if (ret.IsEmpty()) { if (ret.IsEmpty()) {
fatal_exception(try_catch); FatalException(try_catch);
return -2; return -2;
} }
if (ret->IsFalse()) return -3; if (ret->IsFalse()) return -3;
@ -356,7 +356,7 @@ HTTPServer::OnConnection (struct sockaddr *addr, socklen_t len)
HTTPConnection::server_constructor_template->GetFunction()->NewInstance(0, NULL); HTTPConnection::server_constructor_template->GetFunction()->NewInstance(0, NULL);
if (connection_handle.IsEmpty()) { if (connection_handle.IsEmpty()) {
fatal_exception(try_catch); FatalException(try_catch);
return NULL; return NULL;
} }
@ -370,7 +370,7 @@ HTTPServer::OnConnection (struct sockaddr *addr, socklen_t len)
Local<Value> ret = connection_handler->Call(handle_, 1, argv); Local<Value> ret = connection_handler->Call(handle_, 1, argv);
if (ret.IsEmpty()) if (ret.IsEmpty())
fatal_exception(try_catch); FatalException(try_catch);
return connection; return connection;
} }

8
src/net.cc

@ -419,7 +419,7 @@ Connection::OnReceive (const void *buf, size_t len)
callback->Call(handle_, argc, argv); callback->Call(handle_, argc, argv);
if (try_catch.HasCaught()) if (try_catch.HasCaught())
fatal_exception(try_catch); FatalException(try_catch);
} }
#define DEFINE_SIMPLE_CALLBACK(name, symbol) \ #define DEFINE_SIMPLE_CALLBACK(name, symbol) \
@ -432,7 +432,7 @@ void name () \
TryCatch try_catch; \ TryCatch try_catch; \
callback->Call(handle_, 0, NULL); \ callback->Call(handle_, 0, NULL); \
if (try_catch.HasCaught()) \ if (try_catch.HasCaught()) \
node::fatal_exception(try_catch); \ node::FatalException(try_catch); \
} }
DEFINE_SIMPLE_CALLBACK(Connection::OnConnect, ON_CONNECT_SYMBOL) DEFINE_SIMPLE_CALLBACK(Connection::OnConnect, ON_CONNECT_SYMBOL)
@ -500,7 +500,7 @@ Acceptor::OnConnection (struct sockaddr *addr, socklen_t len)
Connection::constructor_template->GetFunction()->NewInstance(0, NULL); Connection::constructor_template->GetFunction()->NewInstance(0, NULL);
if (connection_handle.IsEmpty()) { if (connection_handle.IsEmpty()) {
fatal_exception(try_catch); FatalException(try_catch);
return NULL; return NULL;
} }
@ -514,7 +514,7 @@ Acceptor::OnConnection (struct sockaddr *addr, socklen_t len)
Local<Value> ret = connection_handler->Call(handle_, 1, argv); Local<Value> ret = connection_handler->Call(handle_, 1, argv);
if (ret.IsEmpty()) if (ret.IsEmpty())
fatal_exception(try_catch); FatalException(try_catch);
return connection; return connection;
} }

2
src/node.cc

@ -210,7 +210,7 @@ OnFatalError (const char* location, const char* message)
void void
node::fatal_exception (TryCatch &try_catch) node::FatalException (TryCatch &try_catch)
{ {
ReportException(&try_catch); ReportException(&try_catch);
::exit(1); ::exit(1);

2
src/node.h

@ -25,7 +25,7 @@ do { \
enum encoding {ASCII, UTF8, RAW}; enum encoding {ASCII, UTF8, RAW};
enum encoding ParseEncoding (v8::Handle<v8::Value> encoding_v); enum encoding ParseEncoding (v8::Handle<v8::Value> encoding_v);
void fatal_exception (v8::TryCatch &try_catch); void FatalException (v8::TryCatch &try_catch);
void eio_warmup (void); // call this before creating a new eio event. void eio_warmup (void); // call this before creating a new eio event.
class ObjectWrap { class ObjectWrap {

2
src/timer.cc

@ -40,7 +40,7 @@ Timer::OnTimeout (EV_P_ ev_timer *watcher, int revents)
TryCatch try_catch; TryCatch try_catch;
callback->Call (timer->handle_, 0, NULL); callback->Call (timer->handle_, 0, NULL);
if (try_catch.HasCaught()) if (try_catch.HasCaught())
fatal_exception(try_catch); FatalException(try_catch);
/* XXX i'm a bit worried if this is the correct test? /* XXX i'm a bit worried if this is the correct test?
* it's rather crutial for memory leaks the conditional here test to see * it's rather crutial for memory leaks the conditional here test to see

Loading…
Cancel
Save