summaryrefslogtreecommitdiff
path: root/src/node_union_bytes.h
diff options
context:
space:
mode:
authorZYSzys <17367077526@163.com>2019-02-04 15:38:51 +0800
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-02-07 07:22:38 +0100
commit93e0c6ae8997e0ded6013078efd0ccc652ca2595 (patch)
tree335126a828eb71730196f0df21998a3eaf0f5328 /src/node_union_bytes.h
parent2a212549dc0517f1700db90d66ed5cf09e9513b8 (diff)
downloadandroid-node-v8-93e0c6ae8997e0ded6013078efd0ccc652ca2595.tar.gz
android-node-v8-93e0c6ae8997e0ded6013078efd0ccc652ca2595.tar.bz2
android-node-v8-93e0c6ae8997e0ded6013078efd0ccc652ca2595.zip
src: use NULL check macros to check nullptr
PR-URL: https://github.com/nodejs/node/pull/25916 Refs: https://github.com/nodejs/node/pull/20914 Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'src/node_union_bytes.h')
-rw-r--r--src/node_union_bytes.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/node_union_bytes.h b/src/node_union_bytes.h
index 66d8509bea..33fada7303 100644
--- a/src/node_union_bytes.h
+++ b/src/node_union_bytes.h
@@ -64,22 +64,22 @@ class UnionBytes {
bool is_one_byte() const { return is_one_byte_; }
const uint16_t* two_bytes_data() const {
CHECK(!is_one_byte_);
- CHECK_NE(two_bytes_, nullptr);
+ CHECK_NOT_NULL(two_bytes_);
return two_bytes_;
}
const uint8_t* one_bytes_data() const {
CHECK(is_one_byte_);
- CHECK_NE(one_bytes_, nullptr);
+ CHECK_NOT_NULL(one_bytes_);
return one_bytes_;
}
v8::Local<v8::String> ToStringChecked(v8::Isolate* isolate) const {
if (is_one_byte_) {
- CHECK_NE(one_bytes_, nullptr);
+ CHECK_NOT_NULL(one_bytes_);
NonOwningExternalOneByteResource* source =
new NonOwningExternalOneByteResource(one_bytes_, length_);
return v8::String::NewExternalOneByte(isolate, source).ToLocalChecked();
} else {
- CHECK_NE(two_bytes_, nullptr);
+ CHECK_NOT_NULL(two_bytes_);
NonOwningExternalTwoByteResource* source =
new NonOwningExternalTwoByteResource(two_bytes_, length_);
return v8::String::NewExternalTwoByte(isolate, source).ToLocalChecked();