From e80043fb61ee5fda8dd253f03c509d70da7ad4d0 Mon Sep 17 00:00:00 2001 From: Mestery Date: Thu, 17 Feb 2022 08:04:39 +0100 Subject: [PATCH] lib: stop installing webcrypto if `no_browser_globals` is `true` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/node/pull/41969#issuecomment-1039448684 PR-URL: https://github.com/nodejs/node/pull/41971 Reviewed-By: Luigi Pinca Reviewed-By: Nitzan Uziely Reviewed-By: Filip Skokan Reviewed-By: Michaƫl Zasso Reviewed-By: Darshan Sen --- lib/internal/bootstrap/pre_execution.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index 0262497747fc23..da4c2d2a2adeaa 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -168,7 +168,8 @@ function setupFetch() { // TODO(aduh95): move this to internal/bootstrap/browser when the CLI flag is // removed. function setupWebCrypto() { - if (!getOptionValue('--experimental-global-webcrypto')) { + if (process.config.variables.node_no_browser_globals || + !getOptionValue('--experimental-global-webcrypto')) { return; }