From cca74a4e30d64d8e9478231ca4f52a941246fac4 Mon Sep 17 00:00:00 2001 From: Beni von Cheni Date: Tue, 11 Dec 2018 02:05:18 -0500 Subject: [PATCH 01/12] lib: migrate process.binding to internalBinding for misc modules In places of process.binding, migrate to adapt internalBinding, for miscellaneous, identified source code & tests for various modules. Refs: https://github.com/nodejs/node/issues/22160 --- .../node-inspect/lib/internal/inspect_repl.js | 2 +- lib/stream.js | 2 +- .../test-zlib.zlib-binding.deflate.js | 2 +- test/parallel/test-accessor-properties.js | 2 +- test/parallel/test-binding-constants.js | 4 ++- ...est-child-process-spawnsync-kill-signal.js | 3 +- ...ild-process-spawnsync-validation-errors.js | 4 ++- test/parallel/test-constants.js | 4 ++- test/parallel/test-dgram-bind-fd.js | 2 +- test/parallel/test-fs-readdir-types.js | 6 ++-- .../test-loaders-hidden-from-users.js | 3 +- ...ocess-binding-internalbinding-whitelist.js | 36 +++++++++++++------ test/parallel/test-process-binding.js | 2 +- .../test-process-constants-noatime.js | 4 ++- test/parallel/test-util-inspect.js | 2 +- 15 files changed, 53 insertions(+), 25 deletions(-) diff --git a/deps/node-inspect/lib/internal/inspect_repl.js b/deps/node-inspect/lib/internal/inspect_repl.js index 38fe4684cf6d71..746f3418b9bf0f 100644 --- a/deps/node-inspect/lib/internal/inspect_repl.js +++ b/deps/node-inspect/lib/internal/inspect_repl.js @@ -84,7 +84,7 @@ function extractFunctionName(description) { return fnNameMatch ? `: ${fnNameMatch[1]}` : ''; } -const NATIVES = process.binding('natives'); +const NATIVES = internalBinding('natives'); function isNativeUrl(url) { return url.replace('.js', '') in NATIVES || url === 'bootstrap_node.js'; } diff --git a/lib/stream.js b/lib/stream.js index dfe61aaf09d95d..befca604dc9f86 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -52,7 +52,7 @@ try { // Please do not convert process.binding() to internalBinding() here. // This is for compatibility with older versions when loaded as // readable-stream. - Stream._isUint8Array = process.binding('util').isUint8Array; + Stream._isUint8Array = internalBinding('util').isUint8Array; } } catch (e) { // eslint-disable-line no-unused-vars } diff --git a/test/async-hooks/test-zlib.zlib-binding.deflate.js b/test/async-hooks/test-zlib.zlib-binding.deflate.js index 972052b2d570a5..21fd0af7da5e5a 100644 --- a/test/async-hooks/test-zlib.zlib-binding.deflate.js +++ b/test/async-hooks/test-zlib.zlib-binding.deflate.js @@ -11,7 +11,7 @@ const hooks = initHooks(); hooks.enable(); const { internalBinding } = require('internal/test/binding'); const { Zlib } = internalBinding('zlib'); -const constants = process.binding('constants').zlib; +const constants = internalBinding('constants').zlib; const handle = new Zlib(constants.DEFLATE); diff --git a/test/parallel/test-accessor-properties.js b/test/parallel/test-accessor-properties.js index 95b960b202cd53..463118593ff2a3 100644 --- a/test/parallel/test-accessor-properties.js +++ b/test/parallel/test-accessor-properties.js @@ -57,7 +57,7 @@ const UDP = internalBinding('udp_wrap').UDP; if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check // There are accessor properties in crypto too - const crypto = process.binding('crypto'); + const crypto = internalBinding('crypto'); assert.throws(() => { crypto.SecureContext.prototype._external; diff --git a/test/parallel/test-binding-constants.js b/test/parallel/test-binding-constants.js index 9855af19422882..e989e09b3cd7d6 100644 --- a/test/parallel/test-binding-constants.js +++ b/test/parallel/test-binding-constants.js @@ -1,7 +1,9 @@ +// Flags: --expose-internals 'use strict'; require('../common'); -const constants = process.binding('constants'); +const { internalBinding } = require('internal/test/binding'); +const constants = internalBinding('constants'); const assert = require('assert'); assert.deepStrictEqual( diff --git a/test/parallel/test-child-process-spawnsync-kill-signal.js b/test/parallel/test-child-process-spawnsync-kill-signal.js index 90222e04c97c9e..9d23930b69cb40 100644 --- a/test/parallel/test-child-process-spawnsync-kill-signal.js +++ b/test/parallel/test-child-process-spawnsync-kill-signal.js @@ -9,7 +9,8 @@ if (process.argv[2] === 'child') { } else { const internalCp = require('internal/child_process'); const oldSpawnSync = internalCp.spawnSync; - const { SIGKILL } = process.binding('constants').os.signals; + const { internalBinding } = require('internal/test/binding'); + const { SIGKILL } = internalBinding('constants').os.signals; function spawn(killSignal, beforeSpawn) { if (beforeSpawn) { diff --git a/test/parallel/test-child-process-spawnsync-validation-errors.js b/test/parallel/test-child-process-spawnsync-validation-errors.js index 17545d4af7bf50..265e237f057b71 100644 --- a/test/parallel/test-child-process-spawnsync-validation-errors.js +++ b/test/parallel/test-child-process-spawnsync-validation-errors.js @@ -1,8 +1,10 @@ +// Flags: --expose_internals 'use strict'; const common = require('../common'); const assert = require('assert'); const spawnSync = require('child_process').spawnSync; -const signals = process.binding('constants').os.signals; +const { internalBinding } = require('internal/test/binding'); +const signals = internalBinding('constants').os.signals; const rootUser = common.isWindows ? false : process.getuid() === 0; const invalidArgTypeError = common.expectsError( diff --git a/test/parallel/test-constants.js b/test/parallel/test-constants.js index 945443d8866a2f..001435ac356822 100644 --- a/test/parallel/test-constants.js +++ b/test/parallel/test-constants.js @@ -1,7 +1,9 @@ +// Flags: --expose_internals 'use strict'; require('../common'); -const binding = process.binding('constants'); +const { internalBinding } = require('internal/test/binding'); +const binding = internalBinding('constants'); const constants = require('constants'); const assert = require('assert'); diff --git a/test/parallel/test-dgram-bind-fd.js b/test/parallel/test-dgram-bind-fd.js index 8c81cb118c1001..3ec8bc82eb0c04 100644 --- a/test/parallel/test-dgram-bind-fd.js +++ b/test/parallel/test-dgram-bind-fd.js @@ -8,7 +8,7 @@ const assert = require('assert'); const dgram = require('dgram'); const { internalBinding } = require('internal/test/binding'); const { UDP } = internalBinding('udp_wrap'); -const { UV_UDP_REUSEADDR } = process.binding('constants').os; +const { UV_UDP_REUSEADDR } = internalBinding('constants').os; const BUFFER_SIZE = 4096; diff --git a/test/parallel/test-fs-readdir-types.js b/test/parallel/test-fs-readdir-types.js index fa179eccfe26eb..f345cd034e39e9 100644 --- a/test/parallel/test-fs-readdir-types.js +++ b/test/parallel/test-fs-readdir-types.js @@ -1,3 +1,4 @@ +// Flags: --expose-internals 'use strict'; const common = require('../common'); @@ -6,11 +7,12 @@ const fs = require('fs'); const tmpdir = require('../common/tmpdir'); -const binding = process.binding('fs'); +const { internalBinding } = require('internal/test/binding'); +const binding = internalBinding('fs'); const readdirDir = tmpdir.path; const files = ['empty', 'files', 'for', 'just', 'testing']; -const constants = process.binding('constants').fs; +const constants = internalBinding('constants').fs; const types = { isDirectory: constants.UV_DIRENT_DIR, isFile: constants.UV_DIRENT_FILE, diff --git a/test/parallel/test-loaders-hidden-from-users.js b/test/parallel/test-loaders-hidden-from-users.js index 104681bd792bdf..ab9a997b504baf 100644 --- a/test/parallel/test-loaders-hidden-from-users.js +++ b/test/parallel/test-loaders-hidden-from-users.js @@ -16,7 +16,8 @@ common.expectsError( common.expectsError( () => { const source = 'module.exports = require("internal/bootstrap/loaders")'; - process.binding('natives').owo = source; + const { internalBinding } = require('internal/test/binding'); + internalBinding('natives').owo = source; require('owo'); }, { code: 'MODULE_NOT_FOUND', diff --git a/test/parallel/test-process-binding-internalbinding-whitelist.js b/test/parallel/test-process-binding-internalbinding-whitelist.js index 044757e98dc402..bb224ec6e73423 100644 --- a/test/parallel/test-process-binding-internalbinding-whitelist.js +++ b/test/parallel/test-process-binding-internalbinding-whitelist.js @@ -1,21 +1,37 @@ // Flags: --no-warnings 'use strict'; -require('../common'); +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); const assert = require('assert'); // Assert that whitelisted internalBinding modules are accessible via // process.binding(). -assert(process.binding('uv')); -assert(process.binding('http_parser')); -assert(process.binding('v8')); -assert(process.binding('stream_wrap')); -assert(process.binding('signal_wrap')); -assert(process.binding('contextify')); -assert(process.binding('url')); -assert(process.binding('spawn_sync')); -assert(process.binding('js_stream')); +assert(process.binding('async_wrap')); assert(process.binding('buffer')); +assert(process.binding('cares_wrap')); +assert(process.binding('constants')); +assert(process.binding('contextify')); +assert(process.binding('crypto')); assert(process.binding('fs')); +assert(process.binding('fs_event_wrap')); +assert(process.binding('http_parser')); +assert(process.binding('icu')); assert(process.binding('inspector')); +assert(process.binding('js_stream')); +assert(process.binding('natives')); assert(process.binding('os')); +assert(process.binding('pipe_wrap')); +assert(process.binding('signal_wrap')); +assert(process.binding('spawn_sync')); +assert(process.binding('stream_wrap')); +assert(process.binding('tcp_wrap')); +assert(process.binding('tls_wrap')); +assert(process.binding('tty_wrap')); +assert(process.binding('udp_wrap')); +assert(process.binding('url')); +assert(process.binding('util')); +assert(process.binding('uv')); +assert(process.binding('v8')); +assert(process.binding('zlib')); diff --git a/test/parallel/test-process-binding.js b/test/parallel/test-process-binding.js index 05bb0e6aa07d41..07caba28a96573 100644 --- a/test/parallel/test-process-binding.js +++ b/test/parallel/test-process-binding.js @@ -6,7 +6,7 @@ const { internalBinding } = require('internal/test/binding'); assert.throws( function() { - process.binding('test'); + internalBinding('test'); }, /No such module: test/ ); diff --git a/test/parallel/test-process-constants-noatime.js b/test/parallel/test-process-constants-noatime.js index d0c027f0b9353d..f0af971eddec79 100644 --- a/test/parallel/test-process-constants-noatime.js +++ b/test/parallel/test-process-constants-noatime.js @@ -1,8 +1,10 @@ +// Flags: --expose-internals 'use strict'; const common = require('../common'); const assert = require('assert'); -const constants = process.binding('constants'); +const { internalBinding } = require('internal/test/binding'); +const constants = internalBinding('constants'); if (common.isLinux) { assert('O_NOATIME' in constants.fs); diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index a9afdbf8af049f..a14236f1a230cf 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -23,7 +23,7 @@ const common = require('../common'); const assert = require('assert'); const { internalBinding } = require('internal/test/binding'); -const JSStream = process.binding('js_stream').JSStream; +const JSStream = internalBinding('js_stream').JSStream; const util = require('util'); const vm = require('vm'); const { previewEntries } = internalBinding('util'); From 6b348d38b1a17893c2218659d17cf44e80d21e46 Mon Sep 17 00:00:00 2001 From: Beni von Cheni Date: Sat, 15 Dec 2018 01:05:45 -0500 Subject: [PATCH 02/12] src: revert incorrect internalBinding back to process.binding Revert the previous incorrect migration of internalBinding from process.binding in lib/stream & inspect_repl. Refs: https://github.com/nodejs/node/issues/22160 --- deps/node-inspect/lib/internal/inspect_repl.js | 2 +- lib/stream.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/node-inspect/lib/internal/inspect_repl.js b/deps/node-inspect/lib/internal/inspect_repl.js index 746f3418b9bf0f..38fe4684cf6d71 100644 --- a/deps/node-inspect/lib/internal/inspect_repl.js +++ b/deps/node-inspect/lib/internal/inspect_repl.js @@ -84,7 +84,7 @@ function extractFunctionName(description) { return fnNameMatch ? `: ${fnNameMatch[1]}` : ''; } -const NATIVES = internalBinding('natives'); +const NATIVES = process.binding('natives'); function isNativeUrl(url) { return url.replace('.js', '') in NATIVES || url === 'bootstrap_node.js'; } diff --git a/lib/stream.js b/lib/stream.js index befca604dc9f86..dfe61aaf09d95d 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -52,7 +52,7 @@ try { // Please do not convert process.binding() to internalBinding() here. // This is for compatibility with older versions when loaded as // readable-stream. - Stream._isUint8Array = internalBinding('util').isUint8Array; + Stream._isUint8Array = process.binding('util').isUint8Array; } } catch (e) { // eslint-disable-line no-unused-vars } From bc891a79a1faf8636bdaac489ec2fa3a67d9aeb3 Mon Sep 17 00:00:00 2001 From: Beni von Cheni Date: Sun, 16 Dec 2018 22:20:14 -0500 Subject: [PATCH 03/12] test: update require os constants' signals child process spawnsync tests --- test/parallel/test-child-process-spawnsync-kill-signal.js | 3 +-- .../parallel/test-child-process-spawnsync-validation-errors.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-child-process-spawnsync-kill-signal.js b/test/parallel/test-child-process-spawnsync-kill-signal.js index 9d23930b69cb40..b014a384f65f37 100644 --- a/test/parallel/test-child-process-spawnsync-kill-signal.js +++ b/test/parallel/test-child-process-spawnsync-kill-signal.js @@ -9,8 +9,7 @@ if (process.argv[2] === 'child') { } else { const internalCp = require('internal/child_process'); const oldSpawnSync = internalCp.spawnSync; - const { internalBinding } = require('internal/test/binding'); - const { SIGKILL } = internalBinding('constants').os.signals; + const { SIGKILL } = require('os').constants.signals; function spawn(killSignal, beforeSpawn) { if (beforeSpawn) { diff --git a/test/parallel/test-child-process-spawnsync-validation-errors.js b/test/parallel/test-child-process-spawnsync-validation-errors.js index 265e237f057b71..e6310ef2f3bf1f 100644 --- a/test/parallel/test-child-process-spawnsync-validation-errors.js +++ b/test/parallel/test-child-process-spawnsync-validation-errors.js @@ -3,8 +3,7 @@ const common = require('../common'); const assert = require('assert'); const spawnSync = require('child_process').spawnSync; -const { internalBinding } = require('internal/test/binding'); -const signals = internalBinding('constants').os.signals; +const signals = require('os').constants.signals const rootUser = common.isWindows ? false : process.getuid() === 0; const invalidArgTypeError = common.expectsError( From 1fa0d8f9f391a3e3af5a80ef88e56ff7783b1d34 Mon Sep 17 00:00:00 2001 From: Beni von Cheni Date: Sun, 16 Dec 2018 22:28:20 -0500 Subject: [PATCH 04/12] test: revert to process.binding in test-process-binding.js --- test/parallel/test-process-binding.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-process-binding.js b/test/parallel/test-process-binding.js index 07caba28a96573..05bb0e6aa07d41 100644 --- a/test/parallel/test-process-binding.js +++ b/test/parallel/test-process-binding.js @@ -6,7 +6,7 @@ const { internalBinding } = require('internal/test/binding'); assert.throws( function() { - internalBinding('test'); + process.binding('test'); }, /No such module: test/ ); From 15c5aeab84e9fc4b02ac1cf0679b6d65b560bd41 Mon Sep 17 00:00:00 2001 From: Beni von Cheni Date: Sun, 16 Dec 2018 22:34:12 -0500 Subject: [PATCH 05/12] test: update require fs constants in test-process-constants-noatime.js --- test/parallel/test-process-constants-noatime.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-process-constants-noatime.js b/test/parallel/test-process-constants-noatime.js index f0af971eddec79..bd1a848ed7aa74 100644 --- a/test/parallel/test-process-constants-noatime.js +++ b/test/parallel/test-process-constants-noatime.js @@ -1,14 +1,12 @@ -// Flags: --expose-internals 'use strict'; const common = require('../common'); const assert = require('assert'); -const { internalBinding } = require('internal/test/binding'); -const constants = internalBinding('constants'); +const constants = require('fs').constants; if (common.isLinux) { - assert('O_NOATIME' in constants.fs); - assert.strictEqual(constants.fs.O_NOATIME, 0x40000); + assert('O_NOATIME' in constants); + assert.strictEqual(constants.O_NOATIME, 0x40000); } else { - assert(!('O_NOATIME' in constants.fs)); + assert(!('O_NOATIME' in constants)); } From 081db81c80313b515adc5c17e9709216058116c8 Mon Sep 17 00:00:00 2001 From: Beni von Cheni Date: Sun, 16 Dec 2018 22:40:27 -0500 Subject: [PATCH 06/12] test: add semicolon in test-child-process-spawnsync-validation-errors.js --- test/parallel/test-child-process-spawnsync-validation-errors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-child-process-spawnsync-validation-errors.js b/test/parallel/test-child-process-spawnsync-validation-errors.js index e6310ef2f3bf1f..a19f6d0633a218 100644 --- a/test/parallel/test-child-process-spawnsync-validation-errors.js +++ b/test/parallel/test-child-process-spawnsync-validation-errors.js @@ -3,7 +3,7 @@ const common = require('../common'); const assert = require('assert'); const spawnSync = require('child_process').spawnSync; -const signals = require('os').constants.signals +const signals = require('os').constants.signals; const rootUser = common.isWindows ? false : process.getuid() === 0; const invalidArgTypeError = common.expectsError( From 741e63d704b7be7f7b135adee1c6b5be71f1d1a2 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 16 Dec 2018 22:59:02 -0500 Subject: [PATCH 07/12] Update test/parallel/test-fs-readdir-types.js Co-Authored-By: BeniCheni --- test/parallel/test-fs-readdir-types.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-fs-readdir-types.js b/test/parallel/test-fs-readdir-types.js index f345cd034e39e9..96a3b73098728d 100644 --- a/test/parallel/test-fs-readdir-types.js +++ b/test/parallel/test-fs-readdir-types.js @@ -12,7 +12,7 @@ const binding = internalBinding('fs'); const readdirDir = tmpdir.path; const files = ['empty', 'files', 'for', 'just', 'testing']; -const constants = internalBinding('constants').fs; +const constants = require('fs').constants; const types = { isDirectory: constants.UV_DIRENT_DIR, isFile: constants.UV_DIRENT_FILE, From 0f4db2da648bdaa924fa391dd13ecb7b996e0c4e Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 16 Dec 2018 23:00:11 -0500 Subject: [PATCH 08/12] test: update require os constants in test-dgram-bind-fd.js Co-Authored-By: BeniCheni --- test/parallel/test-dgram-bind-fd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-dgram-bind-fd.js b/test/parallel/test-dgram-bind-fd.js index 3ec8bc82eb0c04..a1382d93ff3889 100644 --- a/test/parallel/test-dgram-bind-fd.js +++ b/test/parallel/test-dgram-bind-fd.js @@ -8,7 +8,7 @@ const assert = require('assert'); const dgram = require('dgram'); const { internalBinding } = require('internal/test/binding'); const { UDP } = internalBinding('udp_wrap'); -const { UV_UDP_REUSEADDR } = internalBinding('constants').os; +const { UV_UDP_REUSEADDR } = require('os').constants; const BUFFER_SIZE = 4096; From 63a7690cc972ff7198b55a8b27c71e1d70de4f7f Mon Sep 17 00:00:00 2001 From: Beni von Cheni Date: Fri, 22 Feb 2019 22:42:45 -0500 Subject: [PATCH 09/12] test: remove unused flag in child process spawnsync validation errors test --- test/parallel/test-child-process-spawnsync-validation-errors.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/parallel/test-child-process-spawnsync-validation-errors.js b/test/parallel/test-child-process-spawnsync-validation-errors.js index a19f6d0633a218..9c8a409c752d04 100644 --- a/test/parallel/test-child-process-spawnsync-validation-errors.js +++ b/test/parallel/test-child-process-spawnsync-validation-errors.js @@ -1,4 +1,3 @@ -// Flags: --expose_internals 'use strict'; const common = require('../common'); const assert = require('assert'); From ae788ad0a2531cac3151e9c0ddda9ef90435e2a1 Mon Sep 17 00:00:00 2001 From: Beni von Cheni Date: Wed, 27 Feb 2019 08:35:11 -0500 Subject: [PATCH 10/12] test: enable common.hasCrypto test for internal binding whitelist test --- .../test-process-binding-internalbinding-whitelist.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-process-binding-internalbinding-whitelist.js b/test/parallel/test-process-binding-internalbinding-whitelist.js index bb224ec6e73423..c27b6e9b9de02a 100644 --- a/test/parallel/test-process-binding-internalbinding-whitelist.js +++ b/test/parallel/test-process-binding-internalbinding-whitelist.js @@ -2,8 +2,6 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); const assert = require('assert'); // Assert that whitelisted internalBinding modules are accessible via @@ -13,7 +11,9 @@ assert(process.binding('buffer')); assert(process.binding('cares_wrap')); assert(process.binding('constants')); assert(process.binding('contextify')); -assert(process.binding('crypto')); +if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check + assert(process.binding('crypto')); +} assert(process.binding('fs')); assert(process.binding('fs_event_wrap')); assert(process.binding('http_parser')); From d9f173029f335422dcccc4f8959eccf7adb9cdda Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 5 Mar 2019 00:25:35 +0100 Subject: [PATCH 11/12] fixup --- .../test-process-binding-internalbinding-whitelist.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-process-binding-internalbinding-whitelist.js b/test/parallel/test-process-binding-internalbinding-whitelist.js index c27b6e9b9de02a..c0bfcaef4e5ee2 100644 --- a/test/parallel/test-process-binding-internalbinding-whitelist.js +++ b/test/parallel/test-process-binding-internalbinding-whitelist.js @@ -17,7 +17,9 @@ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check assert(process.binding('fs')); assert(process.binding('fs_event_wrap')); assert(process.binding('http_parser')); -assert(process.binding('icu')); +if (common.hasIntl) { + assert(process.binding('icu')); +} assert(process.binding('inspector')); assert(process.binding('js_stream')); assert(process.binding('natives')); From feddd9d51c181ebb83e87b9e2c4e69c6d4ee5973 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 5 Mar 2019 22:38:08 +0100 Subject: [PATCH 12/12] fixup --- .../test-process-binding-internalbinding-whitelist.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-process-binding-internalbinding-whitelist.js b/test/parallel/test-process-binding-internalbinding-whitelist.js index c0bfcaef4e5ee2..9768ef66741aa3 100644 --- a/test/parallel/test-process-binding-internalbinding-whitelist.js +++ b/test/parallel/test-process-binding-internalbinding-whitelist.js @@ -29,7 +29,9 @@ assert(process.binding('signal_wrap')); assert(process.binding('spawn_sync')); assert(process.binding('stream_wrap')); assert(process.binding('tcp_wrap')); -assert(process.binding('tls_wrap')); +if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check + assert(process.binding('tls_wrap')); +} assert(process.binding('tty_wrap')); assert(process.binding('udp_wrap')); assert(process.binding('url'));