summaryrefslogtreecommitdiff
path: root/src/node_http_parser.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/node_http_parser.cc
parent13493e99bfd208bc6e5381a918384049384cc2ed (diff)
downloadnode-new-39f209649fc290fe92cc3b87edfffa6a854ecb03.tar.gz
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_http_parser.cc')
-rw-r--r--src/node_http_parser.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc
index d6f9b110c3..7d96466c39 100644
--- a/src/node_http_parser.cc
+++ b/src/node_http_parser.cc
@@ -406,7 +406,7 @@ class Parser : public AsyncWrap, public StreamListener {
ASSIGN_OR_RETURN_UNWRAP(&parser, args.Holder());
CHECK(parser->current_buffer_.IsEmpty());
CHECK_EQ(parser->current_buffer_len_, 0);
- CHECK_EQ(parser->current_buffer_data_, nullptr);
+ CHECK_NULL(parser->current_buffer_data_);
CHECK_EQ(Buffer::HasInstance(args[0]), true);
Local<Object> buffer_obj = args[0].As<Object>();
@@ -487,7 +487,7 @@ class Parser : public AsyncWrap, public StreamListener {
CHECK(args[0]->IsExternal());
Local<External> stream_obj = args[0].As<External>();
StreamBase* stream = static_cast<StreamBase*>(stream_obj->Value());
- CHECK_NE(stream, nullptr);
+ CHECK_NOT_NULL(stream);
stream->PushStreamListener(parser);
}