From 592f5bd49cd57b114c48446238d78afc7e7bb664 Mon Sep 17 00:00:00 2001 From: Ouyang Yadong Date: Thu, 25 Oct 2018 14:05:41 +0800 Subject: [PATCH] src: use "constants" string instead of creating new one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using the same "constants" string in c++. PR-URL: https://github.com/nodejs/node/pull/23894 Reviewed-By: Anna Henningsen Reviewed-By: Michaël Zasso Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Trivikram Kamat Reviewed-By: Сковорода Никита Андреевич --- src/node_http2.cc | 2 +- src/pipe_wrap.cc | 2 +- src/tcp_wrap.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node_http2.cc b/src/node_http2.cc index 7e5e49f47e4f82..0b97e524b3dbc3 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -3114,7 +3114,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 90ba87b2d55d09..7f7e2250439763 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -109,7 +109,7 @@ void PipeWrap::Initialize(Local 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 f653297fc0ac8b..a6cc01f1288928 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -124,7 +124,7 @@ void TCPWrap::Initialize(Local 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(); }