Skip to content

Commit 063b40e

Browse files
oyydtargos
authored andcommitted
src: use "constants" string instead of creating new one
Using the same "constants" string in c++. PR-URL: #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>
1 parent d6bcf8b commit 063b40e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/node_http2.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3111,7 +3111,7 @@ HTTP_STATUS_CODES(V)
31113111
env->SetMethod(target, "packSettings", PackSettings);
31123112

31133113
target->Set(context,
3114-
FIXED_ONE_BYTE_STRING(isolate, "constants"),
3114+
env->constants_string(),
31153115
constants).FromJust();
31163116
target->Set(context,
31173117
FIXED_ONE_BYTE_STRING(isolate, "nameForErrorCode"),

src/pipe_wrap.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void PipeWrap::Initialize(Local<Object> target,
109109
NODE_DEFINE_CONSTANT(constants, UV_READABLE);
110110
NODE_DEFINE_CONSTANT(constants, UV_WRITABLE);
111111
target->Set(context,
112-
FIXED_ONE_BYTE_STRING(env->isolate(), "constants"),
112+
env->constants_string(),
113113
constants).FromJust();
114114
}
115115

src/tcp_wrap.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void TCPWrap::Initialize(Local<Object> target,
124124
NODE_DEFINE_CONSTANT(constants, SOCKET);
125125
NODE_DEFINE_CONSTANT(constants, SERVER);
126126
target->Set(context,
127-
FIXED_ONE_BYTE_STRING(env->isolate(), "constants"),
127+
env->constants_string(),
128128
constants).FromJust();
129129
}
130130

0 commit comments

Comments
 (0)