From 15bcb4cbaebb1e24bac04dafac3ae4d379dcc3a1 Mon Sep 17 00:00:00 2001 From: Mestery Date: Mon, 14 Feb 2022 20:23:57 +0100 Subject: [PATCH] lib: stop installing webcrypto if `no_browser_globals` is `true` Refs: https://github.com/nodejs/node/pull/41969#issuecomment-1039448684 --- 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 ca7063ac90d87d..49ecd1f5b98e08 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -167,7 +167,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; }