lib: make pipe_wrap binding internal
PR-URL: https://github.com/nodejs/node/pull/22482 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
df073cdda4
commit
6a689c8aa3
@ -35,7 +35,7 @@ const debug = util.debuglog('tls');
|
|||||||
const { internalBinding } = require('internal/bootstrap/loaders');
|
const { internalBinding } = require('internal/bootstrap/loaders');
|
||||||
const { TCP, constants: TCPConstants } = internalBinding('tcp_wrap');
|
const { TCP, constants: TCPConstants } = internalBinding('tcp_wrap');
|
||||||
const tls_wrap = internalBinding('tls_wrap');
|
const tls_wrap = internalBinding('tls_wrap');
|
||||||
const { Pipe, constants: PipeConstants } = process.binding('pipe_wrap');
|
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
|
||||||
const { owner_symbol } = require('internal/async_hooks').symbols;
|
const { owner_symbol } = require('internal/async_hooks').symbols;
|
||||||
const { SecureContext: NativeSecureContext } = internalBinding('crypto');
|
const { SecureContext: NativeSecureContext } = internalBinding('crypto');
|
||||||
const {
|
const {
|
||||||
|
@ -28,7 +28,8 @@ const {
|
|||||||
const { isArrayBufferView } = require('internal/util/types');
|
const { isArrayBufferView } = require('internal/util/types');
|
||||||
const debug = util.debuglog('child_process');
|
const debug = util.debuglog('child_process');
|
||||||
const { Buffer } = require('buffer');
|
const { Buffer } = require('buffer');
|
||||||
const { Pipe, constants: PipeConstants } = process.binding('pipe_wrap');
|
const { internalBinding } = require('internal/bootstrap/loaders');
|
||||||
|
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
|
||||||
const {
|
const {
|
||||||
ERR_INVALID_ARG_VALUE,
|
ERR_INVALID_ARG_VALUE,
|
||||||
ERR_CHILD_PROCESS_IPC_REQUIRED,
|
ERR_CHILD_PROCESS_IPC_REQUIRED,
|
||||||
|
@ -350,6 +350,7 @@
|
|||||||
new SafeSet([
|
new SafeSet([
|
||||||
'fs_event_wrap',
|
'fs_event_wrap',
|
||||||
'uv',
|
'uv',
|
||||||
|
'pipe_wrap',
|
||||||
'http_parser',
|
'http_parser',
|
||||||
'process_wrap',
|
'process_wrap',
|
||||||
'v8',
|
'v8',
|
||||||
|
@ -25,7 +25,7 @@ const { internalBinding } = require('internal/bootstrap/loaders');
|
|||||||
|
|
||||||
const { Process } = internalBinding('process_wrap');
|
const { Process } = internalBinding('process_wrap');
|
||||||
const { WriteWrap } = internalBinding('stream_wrap');
|
const { WriteWrap } = internalBinding('stream_wrap');
|
||||||
const { Pipe, constants: PipeConstants } = process.binding('pipe_wrap');
|
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
|
||||||
const { TCP } = internalBinding('tcp_wrap');
|
const { TCP } = internalBinding('tcp_wrap');
|
||||||
const { TTY } = internalBinding('tty_wrap');
|
const { TTY } = internalBinding('tty_wrap');
|
||||||
const { UDP } = process.binding('udp_wrap');
|
const { UDP } = process.binding('udp_wrap');
|
||||||
|
@ -53,7 +53,7 @@ const {
|
|||||||
Pipe,
|
Pipe,
|
||||||
PipeConnectWrap,
|
PipeConnectWrap,
|
||||||
constants: PipeConstants
|
constants: PipeConstants
|
||||||
} = process.binding('pipe_wrap');
|
} = internalBinding('pipe_wrap');
|
||||||
const {
|
const {
|
||||||
newAsyncId,
|
newAsyncId,
|
||||||
defaultTriggerAsyncIdScope,
|
defaultTriggerAsyncIdScope,
|
||||||
|
@ -242,4 +242,4 @@ void PipeWrap::Connect(const FunctionCallbackInfo<Value>& args) {
|
|||||||
|
|
||||||
} // namespace node
|
} // namespace node
|
||||||
|
|
||||||
NODE_BUILTIN_MODULE_CONTEXT_AWARE(pipe_wrap, node::PipeWrap::Initialize)
|
NODE_MODULE_CONTEXT_AWARE_INTERNAL(pipe_wrap, node::PipeWrap::Initialize)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const strictEqual = require('assert').strictEqual;
|
const strictEqual = require('assert').strictEqual;
|
||||||
|
const { internalBinding } = require('internal/test/binding');
|
||||||
|
|
||||||
// child_process
|
// child_process
|
||||||
{
|
{
|
||||||
@ -72,7 +73,7 @@ const { kStateSymbol } = require('internal/dgram');
|
|||||||
|
|
||||||
// pipe
|
// pipe
|
||||||
{
|
{
|
||||||
const { Pipe, constants: PipeConstants } = process.binding('pipe_wrap');
|
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
|
||||||
const handle = new Pipe(PipeConstants.SOCKET);
|
const handle = new Pipe(PipeConstants.SOCKET);
|
||||||
strictEqual(Object.getPrototypeOf(handle).hasOwnProperty('hasRef'),
|
strictEqual(Object.getPrototypeOf(handle).hasOwnProperty('hasRef'),
|
||||||
true, 'pipe_wrap: hasRef() missing');
|
true, 'pipe_wrap: hasRef() missing');
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// Flags: --expose-internals
|
||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
if (common.isWindows)
|
if (common.isWindows)
|
||||||
@ -6,7 +7,8 @@ if (common.isWindows)
|
|||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { Pipe, constants: PipeConstants } = process.binding('pipe_wrap');
|
const { internalBinding } = require('internal/test/binding');
|
||||||
|
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
|
||||||
|
|
||||||
const tmpdir = require('../common/tmpdir');
|
const tmpdir = require('../common/tmpdir');
|
||||||
tmpdir.refresh();
|
tmpdir.refresh();
|
||||||
|
@ -8,7 +8,7 @@ const fs = require('fs');
|
|||||||
const { getSystemErrorName } = require('util');
|
const { getSystemErrorName } = require('util');
|
||||||
const { internalBinding } = require('internal/test/binding');
|
const { internalBinding } = require('internal/test/binding');
|
||||||
const { TCP, constants: TCPConstants } = internalBinding('tcp_wrap');
|
const { TCP, constants: TCPConstants } = internalBinding('tcp_wrap');
|
||||||
const { Pipe, constants: PipeConstants } = process.binding('pipe_wrap');
|
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
|
||||||
|
|
||||||
const tmpdir = require('../common/tmpdir');
|
const tmpdir = require('../common/tmpdir');
|
||||||
tmpdir.refresh();
|
tmpdir.refresh();
|
||||||
|
@ -25,7 +25,7 @@ require('../common');
|
|||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const { internalBinding } = require('internal/test/binding');
|
const { internalBinding } = require('internal/test/binding');
|
||||||
const Process = internalBinding('process_wrap').Process;
|
const Process = internalBinding('process_wrap').Process;
|
||||||
const { Pipe, constants: PipeConstants } = process.binding('pipe_wrap');
|
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
|
||||||
const pipe = new Pipe(PipeConstants.SOCKET);
|
const pipe = new Pipe(PipeConstants.SOCKET);
|
||||||
const p = new Process();
|
const p = new Process();
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const binding = process.binding('pipe_wrap');
|
const binding = internalBinding('pipe_wrap');
|
||||||
const handle = new binding.Pipe(binding.constants.IPC);
|
const handle = new binding.Pipe(binding.constants.IPC);
|
||||||
testInitialized(handle, 'Pipe');
|
testInitialized(handle, 'Pipe');
|
||||||
}
|
}
|
||||||
@ -169,7 +169,7 @@ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
|
|||||||
const server = net.createServer(common.mustCall((socket) => {
|
const server = net.createServer(common.mustCall((socket) => {
|
||||||
server.close();
|
server.close();
|
||||||
})).listen(common.PIPE, common.mustCall(() => {
|
})).listen(common.PIPE, common.mustCall(() => {
|
||||||
const binding = process.binding('pipe_wrap');
|
const binding = internalBinding('pipe_wrap');
|
||||||
const handle = new binding.Pipe(binding.constants.SOCKET);
|
const handle = new binding.Pipe(binding.constants.SOCKET);
|
||||||
testInitialized(handle, 'Pipe');
|
testInitialized(handle, 'Pipe');
|
||||||
const req = new binding.PipeConnectWrap();
|
const req = new binding.PipeConnectWrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user