From ae5c463241879ca2d3a0efd0f32ff9bd42f3f79e Mon Sep 17 00:00:00 2001 From: leah-1ee Date: Wed, 5 Aug 2026 17:08:29 +0900 Subject: [PATCH] src: reuse cached env strings in remaining files Follow-up to #59891, covering files it missed. Overlapping locations (node_ffi.cc, crypto_util.cc) were already handled by #64760. Refs: https://github.com/nodejs/node/pull/59891 Refs: https://github.com/nodejs/node/pull/64760 Refs: https://github.com/nodejs/node/pull/64912 Signed-off-by: leah-1ee --- src/node_constants.cc | 6 +----- src/node_locks.cc | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/node_constants.cc b/src/node_constants.cc index db670789dc06..24416ed4a4d5 100644 --- a/src/node_constants.cc +++ b/src/node_constants.cc @@ -1373,11 +1373,7 @@ void CreatePerContextProperties(Local target, FIXED_ONE_BYTE_STRING(isolate, "dlopen"), dlopen_constants) .Check(); - os_constants - ->Set(env->context(), - FIXED_ONE_BYTE_STRING(isolate, "errno"), - err_constants) - .Check(); + os_constants->Set(env->context(), env->errno_string(), err_constants).Check(); os_constants ->Set(env->context(), FIXED_ONE_BYTE_STRING(isolate, "signals"), diff --git a/src/node_locks.cc b/src/node_locks.cc index 9c871569c4d4..26fac6b62c4c 100644 --- a/src/node_locks.cc +++ b/src/node_locks.cc @@ -817,10 +817,10 @@ void CreatePerIsolateProperties(IsolateData* isolate_data, PropertyAttribute read_only = static_cast( PropertyAttribute::ReadOnly | PropertyAttribute::DontDelete); target->Set(FIXED_ONE_BYTE_STRING(isolate, "LOCK_MODE_SHARED"), - FIXED_ONE_BYTE_STRING(isolate, "shared"), + isolate_data->shared_string(), read_only); target->Set(FIXED_ONE_BYTE_STRING(isolate, "LOCK_MODE_EXCLUSIVE"), - FIXED_ONE_BYTE_STRING(isolate, "exclusive"), + isolate_data->exclusive_string(), read_only); target->Set(FIXED_ONE_BYTE_STRING(isolate, "LOCK_STOLEN_ERROR"), FIXED_ONE_BYTE_STRING(isolate, "LOCK_STOLEN"),