From 2ab877f071d487adf5ff62a23df617b5ed31ffd8 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 fad09f49cc8532..05301ad439c60c 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -186,7 +186,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; }