From 5fdff3854a4253681fb10aa626c8971e50834c10 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 11 Oct 2014 16:52:07 +0200 Subject: 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 --- src/tty_wrap.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/tty_wrap.cc') 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& 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& args) { void TTYWrap::IsTTY(const FunctionCallbackInfo& 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& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); TTYWrap* wrap = Unwrap(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& 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(); -- cgit v1.2.3