summaryrefslogtreecommitdiff
path: root/src/node_zlib.cc
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2017-08-18 21:58:25 -0700
committerJames M Snell <jasnell@gmail.com>2017-08-23 10:35:19 -0700
commit771a03dfe3dba6ac3136bd4aa25525220e29b0ff (patch)
tree9276a1e18c07fcead1ce87a384a7a47e42f00d79 /src/node_zlib.cc
parent0ce54a7ec96431a088a15a5e24614428184497f0 (diff)
downloadandroid-node-v8-771a03dfe3dba6ac3136bd4aa25525220e29b0ff.tar.gz
android-node-v8-771a03dfe3dba6ac3136bd4aa25525220e29b0ff.tar.bz2
android-node-v8-771a03dfe3dba6ac3136bd4aa25525220e29b0ff.zip
src: fixup strings, reduce duplication
PR-URL: https://github.com/nodejs/node/pull/14937 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/node_zlib.cc')
-rw-r--r--src/node_zlib.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/node_zlib.cc b/src/node_zlib.cc
index b66313f179..c29785e37e 100644
--- a/src/node_zlib.cc
+++ b/src/node_zlib.cc
@@ -50,6 +50,7 @@ using v8::Local;
using v8::Number;
using v8::Object;
using v8::Persistent;
+using v8::String;
using v8::Uint32Array;
using v8::Value;
@@ -693,8 +694,9 @@ void InitZlib(Local<Object> target,
env->SetProtoMethod(z, "params", ZCtx::Params);
env->SetProtoMethod(z, "reset", ZCtx::Reset);
- z->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "Zlib"));
- target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "Zlib"), z->GetFunction());
+ Local<String> zlibString = FIXED_ONE_BYTE_STRING(env->isolate(), "Zlib");
+ z->SetClassName(zlibString);
+ target->Set(zlibString, z->GetFunction());
target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "ZLIB_VERSION"),
FIXED_ONE_BYTE_STRING(env->isolate(), ZLIB_VERSION));