diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2014-10-11 16:52:07 +0200 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2014-10-12 02:09:46 +0400 |
commit | 5fdff3854a4253681fb10aa626c8971e50834c10 (patch) | |
tree | baa8b219fff28467b641d4f4f36a5b090f6cc6b2 /src/tty_wrap.cc | |
parent | 75a461d0997e0a040c2194c5309c148f179563e9 (diff) | |
download | node-new-5fdff3854a4253681fb10aa626c8971e50834c10.tar.gz |
src: replace assert() with CHECK()
Mechanically replace assert() statements with UNREACHABLE(), CHECK(),
or CHECK_{EQ,NE,LT,GT,LE,GE}() statements.
The exceptions are src/node.h and src/node_object_wrap.h because they
are public headers.
PR-URL: https://github.com/node-forward/node/pull/16
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'src/tty_wrap.cc')
-rw-r--r-- | src/tty_wrap.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index ec4ad82a72..bd9368d3ac 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -100,7 +100,7 @@ uv_tty_t* TTYWrap::UVHandle() { void TTYWrap::GuessHandleType(const FunctionCallbackInfo<Value>& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); int fd = args[0]->Int32Value(); - assert(fd >= 0); + CHECK_GE(fd, 0); uv_handle_type t = uv_guess_handle(fd); const char* type = NULL; @@ -122,7 +122,7 @@ void TTYWrap::GuessHandleType(const FunctionCallbackInfo<Value>& args) { void TTYWrap::IsTTY(const FunctionCallbackInfo<Value>& args) { int fd = args[0]->Int32Value(); - assert(fd >= 0); + CHECK_GE(fd, 0); bool rc = uv_guess_handle(fd) == UV_TTY; args.GetReturnValue().Set(rc); } @@ -132,7 +132,7 @@ void TTYWrap::GetWindowSize(const FunctionCallbackInfo<Value>& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); TTYWrap* wrap = Unwrap<TTYWrap>(args.Holder()); - assert(args[0]->IsArray()); + CHECK(args[0]->IsArray()); int width, height; int err = uv_tty_get_winsize(&wrap->handle_, &width, &height); @@ -160,10 +160,10 @@ void TTYWrap::New(const FunctionCallbackInfo<Value>& args) { // This constructor should not be exposed to public javascript. // Therefore we assert that we are not trying to call this as a // normal function. - assert(args.IsConstructCall()); + CHECK(args.IsConstructCall()); int fd = args[0]->Int32Value(); - assert(fd >= 0); + CHECK_GE(fd, 0); TTYWrap* wrap = new TTYWrap(env, args.This(), fd, args[1]->IsTrue()); wrap->UpdateWriteQueueSize(); |