lib: unexpose six process bindings

Namely: async_wrap, crypto, http_parser, signal_wrap, url, and v8.

They were runtime-deprecated 4 years ago.

PR-URL: https://github.com/nodejs/node/pull/57149
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Michaël Zasso 2025-02-25 17:07:49 +01:00 committed by GitHub
parent 6cb0690fcc
commit c864dea910
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 23 deletions

View File

@ -112,12 +112,7 @@ const processBindingAllowList = new SafeSet([
]);
const runtimeDeprecatedList = new SafeSet([
'async_wrap',
'crypto',
'http_parser',
'signal_wrap',
'url',
'v8',
// The list of runtime-deprecated bindings is currently empty.
]);
const legacyWrapperList = new SafeSet([

View File

@ -15,14 +15,6 @@ const assert = require('assert');
}));
}
{
assert.throws(() => {
process.binding('async_wrap');
}, common.expectsError({
code: 'ERR_ACCESS_DENIED',
}));
}
{
assert.throws(() => {
process.binding('fs');

View File

@ -1,8 +1,10 @@
// Flags: --expose-internals
'use strict';
const common = require('../common');
const net = require('net');
const { HTTPParser } = process.binding('http_parser');
const { internalBinding } = require('internal/test/binding');
const { HTTPParser } = internalBinding('http_parser');
const server = net.createServer((socket) => {
socket.write('HTTP/1.1 200 OK\r\n');

View File

@ -6,17 +6,12 @@ const assert = require('assert');
// Assert that allowed internalBinding modules are accessible via
// process.binding().
assert(process.binding('async_wrap'));
assert(process.binding('buffer'));
assert(process.binding('cares_wrap'));
assert(process.binding('constants'));
assert(process.binding('contextify'));
if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
assert(process.binding('crypto'));
}
assert(process.binding('fs'));
assert(process.binding('fs_event_wrap'));
assert(process.binding('http_parser'));
if (common.hasIntl) {
assert(process.binding('icu'));
}
@ -25,7 +20,6 @@ assert(process.binding('js_stream'));
assert(process.binding('natives'));
assert(process.binding('os'));
assert(process.binding('pipe_wrap'));
assert(process.binding('signal_wrap'));
assert(process.binding('spawn_sync'));
assert(process.binding('stream_wrap'));
assert(process.binding('tcp_wrap'));
@ -34,8 +28,6 @@ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
}
assert(process.binding('tty_wrap'));
assert(process.binding('udp_wrap'));
assert(process.binding('url'));
assert(process.binding('util'));
assert(process.binding('uv'));
assert(process.binding('v8'));
assert(process.binding('zlib'));