summaryrefslogtreecommitdiff
path: root/src/util-inl.h
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2014-10-11 16:52:07 +0200
committerFedor Indutny <fedor@indutny.com>2014-10-12 02:09:46 +0400
commit5fdff3854a4253681fb10aa626c8971e50834c10 (patch)
treebaa8b219fff28467b641d4f4f36a5b090f6cc6b2 /src/util-inl.h
parent75a461d0997e0a040c2194c5309c148f179563e9 (diff)
downloadnode-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/util-inl.h')
-rw-r--r--src/util-inl.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/util-inl.h b/src/util-inl.h
index 045a27796d..6035cadc09 100644
--- a/src/util-inl.h
+++ b/src/util-inl.h
@@ -24,8 +24,6 @@
#include "util.h"
-#include <assert.h>
-
namespace node {
template <typename Inner, typename Outer>
@@ -102,8 +100,8 @@ inline v8::Local<v8::String> OneByteString(v8::Isolate* isolate,
template <typename TypeName>
void Wrap(v8::Local<v8::Object> object, TypeName* pointer) {
- assert(!object.IsEmpty());
- assert(object->InternalFieldCount() > 0);
+ CHECK_EQ(false, object.IsEmpty());
+ CHECK_GT(object->InternalFieldCount(), 0);
object->SetAlignedPointerInInternalField(0, pointer);
}
@@ -113,8 +111,8 @@ void ClearWrap(v8::Local<v8::Object> object) {
template <typename TypeName>
TypeName* Unwrap(v8::Local<v8::Object> object) {
- assert(!object.IsEmpty());
- assert(object->InternalFieldCount() > 0);
+ CHECK_EQ(false, object.IsEmpty());
+ CHECK_GT(object->InternalFieldCount(), 0);
void* pointer = object->GetAlignedPointerFromInternalField(0);
return static_cast<TypeName*>(pointer);
}