summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-08-23 11:36:43 -0400
committercjihrig <cjihrig@gmail.com>2018-08-29 15:11:59 -0400
commit6a689c8aa3ef3bf517cc86807406b9a8958d4ffb (patch)
tree8d4d99bbffb185724d6976fe404118260e59f915
parentdf073cdda4d9f3afb5ae7a5dd0bd153537b66181 (diff)
downloadnode-new-6a689c8aa3ef3bf517cc86807406b9a8958d4ffb.tar.gz
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>
-rw-r--r--lib/_tls_wrap.js2
-rw-r--r--lib/child_process.js3
-rw-r--r--lib/internal/bootstrap/node.js1
-rw-r--r--lib/internal/child_process.js2
-rw-r--r--lib/net.js2
-rw-r--r--src/pipe_wrap.cc2
-rw-r--r--test/parallel/test-handle-wrap-isrefed.js3
-rw-r--r--test/parallel/test-net-connect-options-fd.js4
-rw-r--r--test/parallel/test-net-server-listen-handle.js2
-rw-r--r--test/parallel/test-process-wrap.js2
-rw-r--r--test/sequential/test-async-wrap-getasyncid.js4
11 files changed, 16 insertions, 11 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js
index 010973fddc..f806d70b99 100644
--- a/lib/_tls_wrap.js
+++ b/lib/_tls_wrap.js
@@ -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 {
diff --git a/lib/child_process.js b/lib/child_process.js
index 1ab4150b01..05afcdbc6c 100644
--- a/lib/child_process.js
+++ b/lib/child_process.js
@@ -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,
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index d65e12cc78..26d0b2710f 100644
--- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js
@@ -350,6 +350,7 @@
new SafeSet([
'fs_event_wrap',
'uv',
+ 'pipe_wrap',
'http_parser',
'process_wrap',
'v8',
diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js
index 6c46aaf34d..70211e99fe 100644
--- a/lib/internal/child_process.js
+++ b/lib/internal/child_process.js
@@ -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');
diff --git a/lib/net.js b/lib/net.js
index c489353b66..33c41c126e 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -53,7 +53,7 @@ const {
Pipe,
PipeConnectWrap,
constants: PipeConstants
-} = process.binding('pipe_wrap');
+} = internalBinding('pipe_wrap');
const {
newAsyncId,
defaultTriggerAsyncIdScope,
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc
index a6044b6b26..8fcf7007f5 100644
--- a/src/pipe_wrap.cc
+++ b/src/pipe_wrap.cc
@@ -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)
diff --git a/test/parallel/test-handle-wrap-isrefed.js b/test/parallel/test-handle-wrap-isrefed.js
index cd0f5a26ca..eb3adf65c1 100644
--- a/test/parallel/test-handle-wrap-isrefed.js
+++ b/test/parallel/test-handle-wrap-isrefed.js
@@ -3,6 +3,7 @@
const common = require('../common');
const strictEqual = require('assert').strictEqual;
+const { internalBinding } = require('internal/test/binding');
// child_process
{
@@ -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');
diff --git a/test/parallel/test-net-connect-options-fd.js b/test/parallel/test-net-connect-options-fd.js
index 76a5e30755..468e230ec7 100644
--- a/test/parallel/test-net-connect-options-fd.js
+++ b/test/parallel/test-net-connect-options-fd.js
@@ -1,3 +1,4 @@
+// Flags: --expose-internals
'use strict';
const common = require('../common');
if (common.isWindows)
@@ -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();
diff --git a/test/parallel/test-net-server-listen-handle.js b/test/parallel/test-net-server-listen-handle.js
index 32af3c3e0e..b1182221fc 100644
--- a/test/parallel/test-net-server-listen-handle.js
+++ b/test/parallel/test-net-server-listen-handle.js
@@ -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();
diff --git a/test/parallel/test-process-wrap.js b/test/parallel/test-process-wrap.js
index 5c91384453..ebbb2af5e9 100644
--- a/test/parallel/test-process-wrap.js
+++ b/test/parallel/test-process-wrap.js
@@ -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();
diff --git a/test/sequential/test-async-wrap-getasyncid.js b/test/sequential/test-async-wrap-getasyncid.js
index eb4b5aef25..6e17b65793 100644
--- a/test/sequential/test-async-wrap-getasyncid.js
+++ b/test/sequential/test-async-wrap-getasyncid.js
@@ -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');
}
@@ -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();