From 063b40edc16f1618626cd6313b1742fcceada472 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 ce5523a9d22aa8..a77f123d32a0bf 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 eb1e06876c2d86..66b9677cc92fec 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 cda30d84105735..d462eff15d391c 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(); }