From 56cf05887841e593240e5b8c4b1d59116234994b Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 23 Aug 2018 11:04:19 -0400 Subject: [PATCH] child_process: make process_wrap binding internal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/22479 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell --- lib/internal/bootstrap/node.js | 1 + lib/internal/child_process.js | 2 +- src/process_wrap.cc | 2 +- test/parallel/test-process-wrap.js | 4 +++- test/sequential/test-async-wrap-getasyncid.js | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 49dedc5fe2a847..3e3eaa5b60e17a 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -350,6 +350,7 @@ new SafeSet([ 'uv', 'http_parser', + 'process_wrap', 'v8', 'stream_wrap', 'signal_wrap', diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 4b321011ca454c..8aad6bcd6f8e07 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -23,7 +23,7 @@ const assert = require('assert'); const { internalBinding } = require('internal/bootstrap/loaders'); -const { Process } = process.binding('process_wrap'); +const { Process } = internalBinding('process_wrap'); const { WriteWrap } = internalBinding('stream_wrap'); const { Pipe, constants: PipeConstants } = process.binding('pipe_wrap'); const { TTY } = process.binding('tty_wrap'); diff --git a/src/process_wrap.cc b/src/process_wrap.cc index b54e17f21192d8..e06afd84ffb7c8 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -315,4 +315,4 @@ class ProcessWrap : public HandleWrap { } // anonymous namespace } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(process_wrap, node::ProcessWrap::Initialize) +NODE_MODULE_CONTEXT_AWARE_INTERNAL(process_wrap, node::ProcessWrap::Initialize) diff --git a/test/parallel/test-process-wrap.js b/test/parallel/test-process-wrap.js index b3cca47c463c19..5c91384453a469 100644 --- a/test/parallel/test-process-wrap.js +++ b/test/parallel/test-process-wrap.js @@ -1,3 +1,4 @@ +// Flags: --expose-internals // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -22,7 +23,8 @@ 'use strict'; require('../common'); const assert = require('assert'); -const Process = process.binding('process_wrap').Process; +const { internalBinding } = require('internal/test/binding'); +const Process = internalBinding('process_wrap').Process; const { Pipe, constants: PipeConstants } = process.binding('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 18a6ed839e55d9..65fe2015a0acd2 100644 --- a/test/sequential/test-async-wrap-getasyncid.js +++ b/test/sequential/test-async-wrap-getasyncid.js @@ -182,7 +182,7 @@ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check } { - const Process = process.binding('process_wrap').Process; + const Process = internalBinding('process_wrap').Process; testInitialized(new Process(), 'Process'); }