diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 265bc81d0c8711..418c93f0d5ac4e 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -376,7 +376,8 @@ 'tls_wrap', 'util', 'async_wrap', - 'url']); + 'url', + 'spawn_sync']); process.binding = function binding(name) { return internalBindingWhitelist.has(name) ? internalBinding(name) : diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index a4850f0238d119..1c5aace9151e88 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -22,7 +22,6 @@ const util = require('util'); const assert = require('assert'); const { internalBinding } = require('internal/bootstrap/loaders'); - const { Process } = internalBinding('process_wrap'); const { WriteWrap } = internalBinding('stream_wrap'); const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap'); @@ -33,7 +32,7 @@ const SocketList = require('internal/socket_list'); const { owner_symbol } = require('internal/async_hooks').symbols; const { convertToValidSignal } = require('internal/util'); const { isArrayBufferView } = require('internal/util/types'); -const spawn_sync = process.binding('spawn_sync'); +const spawn_sync = internalBinding('spawn_sync'); const { HTTPParser } = internalBinding('http_parser'); const { freeParser } = require('_http_common'); const { kStateSymbol } = require('internal/dgram'); diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index 46d895e38a7389..fbcb1d4f02c905 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -1100,5 +1100,5 @@ void SyncProcessRunner::KillTimerCloseCallback(uv_handle_t* handle) { } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(spawn_sync, +NODE_MODULE_CONTEXT_AWARE_INTERNAL(spawn_sync, node::SyncProcessRunner::Initialize) diff --git a/test/parallel/test-process-binding-internalbinding-whitelist.js b/test/parallel/test-process-binding-internalbinding-whitelist.js index 49b4fbd82caee5..7076650e1bce78 100644 --- a/test/parallel/test-process-binding-internalbinding-whitelist.js +++ b/test/parallel/test-process-binding-internalbinding-whitelist.js @@ -13,3 +13,4 @@ assert(process.binding('stream_wrap')); assert(process.binding('signal_wrap')); assert(process.binding('contextify')); assert(process.binding('url')); +assert(process.binding('spawn_sync'));