From b78d448dd8740d5fb53cc6b744ffe084f0f98342 Mon Sep 17 00:00:00 2001 From: Randy Wressell Date: Fri, 12 Oct 2018 10:07:49 -0700 Subject: [PATCH] lib: migrate process.binding to getOptions PR-URL: https://github.com/nodejs/node/pull/23522 Reviewed-By: James M Snell Reviewed-By: Gireesh Punathil Reviewed-By: Trivikram Kamat Reviewed-By: Ruben Bridgewater --- lib/internal/modules/cjs/helpers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/modules/cjs/helpers.js b/lib/internal/modules/cjs/helpers.js index 5b5199c262ae3b..cda94987fad210 100644 --- a/lib/internal/modules/cjs/helpers.js +++ b/lib/internal/modules/cjs/helpers.js @@ -9,6 +9,8 @@ const { CHAR_HASH, } = require('internal/constants'); +const { getOptions } = internalBinding('options'); + // Invoke with makeRequireFunction(module) where |module| is the Module object // to use as the context for the require() function. function makeRequireFunction(mod) { @@ -105,7 +107,7 @@ const builtinLibs = [ 'v8', 'vm', 'zlib' ]; -if (process.binding('config').experimentalWorker) { +if (getOptions('--experimental-worker')) { builtinLibs.push('worker_threads'); builtinLibs.sort(); }