summaryrefslogtreecommitdiff
path: root/src/node_options.cc
diff options
context:
space:
mode:
authorShelley Vohr <shelley.vohr@gmail.com>2020-06-25 18:07:37 -0700
committerShelley Vohr <shelley.vohr@gmail.com>2020-06-29 09:12:11 -0700
commitc23d2fd3f8a018bcc624f1468a9ce176f6ce93f2 (patch)
tree4f868038dc77b7eb64d091ee55ae59729293a0b8 /src/node_options.cc
parent9e135accbb045d52eb65de602c81b5090daae1c4 (diff)
downloadnode-new-c23d2fd3f8a018bcc624f1468a9ce176f6ce93f2.tar.gz
src: allow embedders to disable esm loader
PR-URL: https://github.com/nodejs/node/pull/34060 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'src/node_options.cc')
-rw-r--r--src/node_options.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/node_options.cc b/src/node_options.cc
index d7434b4b12..913366b350 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -979,6 +979,12 @@ void Initialize(Local<Object> target,
context, FIXED_ONE_BYTE_STRING(isolate, "envSettings"), env_settings)
.Check();
+ target
+ ->Set(context,
+ FIXED_ONE_BYTE_STRING(env->isolate(), "shouldNotRegisterESMLoader"),
+ Boolean::New(isolate, env->should_not_register_esm_loader()))
+ .Check();
+
Local<Object> types = Object::New(isolate);
NODE_DEFINE_CONSTANT(types, kNoOp);
NODE_DEFINE_CONSTANT(types, kV8Option);