Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
lib: make pipe_wrap binding internal
PR-URL: #22482
Refs: #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>
  • Loading branch information
cjihrig committed Aug 29, 2018
commit 6a689c8aa3ef3bf517cc86807406b9a8958d4ffb
2 changes: 1 addition & 1 deletion lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const debug = util.debuglog('tls');
const { internalBinding } = require('internal/bootstrap/loaders');
const { TCP, constants: TCPConstants } = internalBinding('tcp_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 { SecureContext: NativeSecureContext } = internalBinding('crypto');
const {
Expand Down
3 changes: 2 additions & 1 deletion lib/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const {
const { isArrayBufferView } = require('internal/util/types');
const debug = util.debuglog('child_process');
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 {
ERR_INVALID_ARG_VALUE,
ERR_CHILD_PROCESS_IPC_REQUIRED,
Expand Down
1 change: 1 addition & 0 deletions lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@
new SafeSet([
'fs_event_wrap',
'uv',
'pipe_wrap',
'http_parser',
'process_wrap',
'v8',
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const { internalBinding } = require('internal/bootstrap/loaders');

const { Process } = internalBinding('process_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 { TTY } = internalBinding('tty_wrap');
const { UDP } = process.binding('udp_wrap');
Expand Down
2 changes: 1 addition & 1 deletion lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const {
Pipe,
PipeConnectWrap,
constants: PipeConstants
} = process.binding('pipe_wrap');
} = internalBinding('pipe_wrap');
const {
newAsyncId,
defaultTriggerAsyncIdScope,
Expand Down
2 changes: 1 addition & 1 deletion src/pipe_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,4 @@ void PipeWrap::Connect(const FunctionCallbackInfo<Value>& args) {

} // namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(pipe_wrap, node::PipeWrap::Initialize)
NODE_MODULE_CONTEXT_AWARE_INTERNAL(pipe_wrap, node::PipeWrap::Initialize)
3 changes: 2 additions & 1 deletion test/parallel/test-handle-wrap-isrefed.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

const common = require('../common');
const strictEqual = require('assert').strictEqual;
const { internalBinding } = require('internal/test/binding');

// child_process
{
Expand Down Expand Up @@ -72,7 +73,7 @@ const { kStateSymbol } = require('internal/dgram');

// pipe
{
const { Pipe, constants: PipeConstants } = process.binding('pipe_wrap');
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
const handle = new Pipe(PipeConstants.SOCKET);
strictEqual(Object.getPrototypeOf(handle).hasOwnProperty('hasRef'),
true, 'pipe_wrap: hasRef() missing');
Expand Down
4 changes: 3 additions & 1 deletion test/parallel/test-net-connect-options-fd.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Flags: --expose-internals
'use strict';
const common = require('../common');
if (common.isWindows)
Expand All @@ -6,7 +7,8 @@ if (common.isWindows)
const assert = require('assert');
const net = require('net');
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');
tmpdir.refresh();
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-net-server-listen-handle.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const fs = require('fs');
const { getSystemErrorName } = require('util');
const { internalBinding } = require('internal/test/binding');
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');
tmpdir.refresh();
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-process-wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require('../common');
const assert = require('assert');
const { internalBinding } = require('internal/test/binding');
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 p = new Process();

Expand Down
4 changes: 2 additions & 2 deletions test/sequential/test-async-wrap-getasyncid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
testInitialized(handle, 'Pipe');
}
Expand All @@ -169,7 +169,7 @@ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
const server = net.createServer(common.mustCall((socket) => {
server.close();
})).listen(common.PIPE, common.mustCall(() => {
const binding = process.binding('pipe_wrap');
const binding = internalBinding('pipe_wrap');
const handle = new binding.Pipe(binding.constants.SOCKET);
testInitialized(handle, 'Pipe');
const req = new binding.PipeConnectWrap();
Expand Down