summaryrefslogtreecommitdiff
path: root/src/process_wrap.cc
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2018-05-20 17:44:06 +0200
committerTobias Nießen <tniessen@tnie.de>2018-05-26 12:29:31 +0200
commit39f209649fc290fe92cc3b87edfffa6a854ecb03 (patch)
treee7c7c595355c3ce1dbd59d89070a7427572d256f /src/process_wrap.cc
parent13493e99bfd208bc6e5381a918384049384cc2ed (diff)
downloadandroid-node-v8-39f209649fc290fe92cc3b87edfffa6a854ecb03.tar.gz
android-node-v8-39f209649fc290fe92cc3b87edfffa6a854ecb03.tar.bz2
android-node-v8-39f209649fc290fe92cc3b87edfffa6a854ecb03.zip
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/process_wrap.cc')
-rw-r--r--src/process_wrap.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/process_wrap.cc b/src/process_wrap.cc
index 6d421fe7c4..54345b231b 100644
--- a/src/process_wrap.cc
+++ b/src/process_wrap.cc
@@ -126,7 +126,7 @@ class ProcessWrap : public HandleWrap {
Local<Object> handle =
stdio->Get(context, handle_key).ToLocalChecked().As<Object>();
uv_stream_t* stream = HandleToStream(env, handle);
- CHECK_NE(stream, nullptr);
+ CHECK_NOT_NULL(stream);
options->stdio[i].flags = UV_INHERIT_STREAM;
options->stdio[i].data.stream = stream;
@@ -197,7 +197,7 @@ class ProcessWrap : public HandleWrap {
node::Utf8Value arg(env->isolate(),
js_argv->Get(context, i).ToLocalChecked());
options.args[i] = strdup(*arg);
- CHECK_NE(options.args[i], nullptr);
+ CHECK_NOT_NULL(options.args[i]);
}
options.args[argc] = nullptr;
}
@@ -223,7 +223,7 @@ class ProcessWrap : public HandleWrap {
node::Utf8Value pair(env->isolate(),
env_opt->Get(context, i).ToLocalChecked());
options.env[i] = strdup(*pair);
- CHECK_NE(options.env[i], nullptr);
+ CHECK_NOT_NULL(options.env[i]);
}
options.env[envc] = nullptr;
}
@@ -294,7 +294,7 @@ class ProcessWrap : public HandleWrap {
int64_t exit_status,
int term_signal) {
ProcessWrap* wrap = static_cast<ProcessWrap*>(handle->data);
- CHECK_NE(wrap, nullptr);
+ CHECK_NOT_NULL(wrap);
CHECK_EQ(&wrap->process_, handle);
Environment* env = wrap->env();