Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2018-05-20 18:44:06 +0300
committerTobias Nießen <tniessen@tnie.de>2018-05-26 13:29:31 +0300
commit39f209649fc290fe92cc3b87edfffa6a854ecb03 (patch)
treee7c7c595355c3ce1dbd59d89070a7427572d256f /src/fs_event_wrap.cc
parent13493e99bfd208bc6e5381a918384049384cc2ed (diff)
src: add CHECK_NULL/CHECK_NOT_NULL macros
This change introduces CHECK_NULL and CHECK_NOT_NULL macros similar to their definition in v8 and replaces instances of CHECK/CHECK_EQ/CHECK_NE with these where it seems appropriate. PR-URL: https://github.com/nodejs/node/pull/20914 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'src/fs_event_wrap.cc')
-rw-r--r--src/fs_event_wrap.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc
index 579e446fc5c..a9ac6795733 100644
--- a/src/fs_event_wrap.cc
+++ b/src/fs_event_wrap.cc
@@ -88,7 +88,7 @@ FSEventWrap::~FSEventWrap() {
void FSEventWrap::GetInitialized(const FunctionCallbackInfo<Value>& args) {
FSEventWrap* wrap = Unwrap<FSEventWrap>(args.This());
- CHECK(wrap != nullptr);
+ CHECK_NOT_NULL(wrap);
args.GetReturnValue().Set(wrap->initialized_);
}
@@ -133,14 +133,14 @@ void FSEventWrap::Start(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
FSEventWrap* wrap = Unwrap<FSEventWrap>(args.This());
- CHECK_NE(wrap, nullptr);
+ CHECK_NOT_NULL(wrap);
CHECK(!wrap->initialized_);
const int argc = args.Length();
CHECK_GE(argc, 4);
BufferValue path(env->isolate(), args[0]);
- CHECK_NE(*path, nullptr);
+ CHECK_NOT_NULL(*path);
unsigned int flags = 0;
if (args[2]->IsTrue())
@@ -233,7 +233,7 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename,
void FSEventWrap::Close(const FunctionCallbackInfo<Value>& args) {
FSEventWrap* wrap = Unwrap<FSEventWrap>(args.Holder());
- CHECK_NE(wrap, nullptr);
+ CHECK_NOT_NULL(wrap);
CHECK(wrap->initialized_);
wrap->initialized_ = false;