summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOuyang Yadong <oyydoibh@gmail.com>2018-10-25 14:05:41 +0800
committerRefael Ackermann <refack@gmail.com>2018-10-30 13:24:24 -0400
commit2cab511d956145579049a5183b5c05fd50fee412 (patch)
tree8faa6b1b51cce7d69e66d7fff650f60c54093c6d
parentbd8c1078941a7a6de93892fe529868adee357917 (diff)
downloadandroid-node-v8-2cab511d956145579049a5183b5c05fd50fee412.tar.gz
android-node-v8-2cab511d956145579049a5183b5c05fd50fee412.tar.bz2
android-node-v8-2cab511d956145579049a5183b5c05fd50fee412.zip
src: use "constants" string instead of creating new one
Using the same "constants" string in c++. PR-URL: https://github.com/nodejs/node/pull/23894 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
-rw-r--r--src/node_http2.cc2
-rw-r--r--src/pipe_wrap.cc2
-rw-r--r--src/tcp_wrap.cc2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/node_http2.cc b/src/node_http2.cc
index ce5523a9d2..a77f123d32 100644
--- a/src/node_http2.cc
+++ b/src/node_http2.cc
@@ -3111,7 +3111,7 @@ HTTP_STATUS_CODES(V)
env->SetMethod(target, "packSettings", PackSettings);
target->Set(context,
- FIXED_ONE_BYTE_STRING(isolate, "constants"),
+ env->constants_string(),
constants).FromJust();
target->Set(context,
FIXED_ONE_BYTE_STRING(isolate, "nameForErrorCode"),
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc
index eb1e06876c..66b9677cc9 100644
--- a/src/pipe_wrap.cc
+++ b/src/pipe_wrap.cc
@@ -109,7 +109,7 @@ void PipeWrap::Initialize(Local<Object> target,
NODE_DEFINE_CONSTANT(constants, UV_READABLE);
NODE_DEFINE_CONSTANT(constants, UV_WRITABLE);
target->Set(context,
- FIXED_ONE_BYTE_STRING(env->isolate(), "constants"),
+ env->constants_string(),
constants).FromJust();
}
diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc
index cda30d8410..d462eff15d 100644
--- a/src/tcp_wrap.cc
+++ b/src/tcp_wrap.cc
@@ -124,7 +124,7 @@ void TCPWrap::Initialize(Local<Object> target,
NODE_DEFINE_CONSTANT(constants, SOCKET);
NODE_DEFINE_CONSTANT(constants, SERVER);
target->Set(context,
- FIXED_ONE_BYTE_STRING(env->isolate(), "constants"),
+ env->constants_string(),
constants).FromJust();
}