os: freeze signals constant

Remove the ability to mutate signals constant as doing so can lead to
unexpected behavior, notably when spawning child process.

Fixes: https://github.com/nodejs/node/issues/44749
PR-URL: https://github.com/nodejs/node/pull/61038
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
This commit is contained in:
Xavier Stouder authored and Antoine du Hamel committed 2026-01-19 19:19:27 +01:00
1 parent e3b5593c0f
commit 54f58e2fb2
2 files changed
+14

No files matched your search

+3
View File
@@ -25,6 +25,7 @@ const {
ArrayPrototypePush,
Float64Array,
ObjectDefineProperties,
ObjectFreeze,
StringPrototypeSlice,
SymbolToPrimitive,
} = primordials;
@@ -330,6 +331,8 @@ module.exports = {
machine: getMachine,
};
ObjectFreeze(constants.signals);
ObjectDefineProperties(module.exports, {
constants: {
__proto__: null,