diff options
author | Tobias Nießen <tniessen@tnie.de> | 2018-05-20 17:44:06 +0200 |
---|---|---|
committer | Tobias Nießen <tniessen@tnie.de> | 2018-05-26 12:29:31 +0200 |
commit | 39f209649fc290fe92cc3b87edfffa6a854ecb03 (patch) | |
tree | e7c7c595355c3ce1dbd59d89070a7427572d256f /src/node_trace_events.cc | |
parent | 13493e99bfd208bc6e5381a918384049384cc2ed (diff) | |
download | android-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/node_trace_events.cc')
-rw-r--r-- | src/node_trace_events.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/node_trace_events.cc b/src/node_trace_events.cc index 363d046de1..13a3dbce1b 100644 --- a/src/node_trace_events.cc +++ b/src/node_trace_events.cc @@ -49,7 +49,7 @@ void NodeCategorySet::New(const FunctionCallbackInfo<Value>& args) { Utf8Value val(env->isolate(), category); categories.emplace(*val); } - CHECK_NE(env->tracing_agent(), nullptr); + CHECK_NOT_NULL(env->tracing_agent()); new NodeCategorySet(env, args.This(), categories); } @@ -57,7 +57,7 @@ void NodeCategorySet::Enable(const FunctionCallbackInfo<Value>& args) { Environment* env = Environment::GetCurrent(args); NodeCategorySet* category_set; ASSIGN_OR_RETURN_UNWRAP(&category_set, args.Holder()); - CHECK_NE(category_set, nullptr); + CHECK_NOT_NULL(category_set); const auto& categories = category_set->GetCategories(); if (!category_set->enabled_ && !categories.empty()) { env->tracing_agent()->Enable(categories); @@ -69,7 +69,7 @@ void NodeCategorySet::Disable(const FunctionCallbackInfo<Value>& args) { Environment* env = Environment::GetCurrent(args); NodeCategorySet* category_set; ASSIGN_OR_RETURN_UNWRAP(&category_set, args.Holder()); - CHECK_NE(category_set, nullptr); + CHECK_NOT_NULL(category_set); const auto& categories = category_set->GetCategories(); if (category_set->enabled_ && !categories.empty()) { env->tracing_agent()->Disable(categories); |