Skip to content

Commit

Permalink
lib: make pipe_wrap binding internal
Browse files Browse the repository at this point in the history
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
1 parent df073cd commit 6a689c8
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 11 deletions.
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

0 comments on commit 6a689c8

Please sign in to comment.