From 4930b18de458ef256f62bc570ff0f8abee883dd2 Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Mon, 25 Sep 2023 20:40:17 -0700 Subject: [PATCH] Review notes --- lib/internal/modules/run_main.js | 1 + src/node_options.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/modules/run_main.js b/lib/internal/modules/run_main.js index 080e56510fbe26..0d8e24cb47a216 100644 --- a/lib/internal/modules/run_main.js +++ b/lib/internal/modules/run_main.js @@ -50,6 +50,7 @@ function shouldUseESMLoader(mainPath) { const { readPackageScope } = require('internal/modules/cjs/loader'); const pkg = readPackageScope(mainPath); + // No need to guard `pkg` as it can only be an object or `false`. return pkg.data?.type === 'module' || getOptionValue('--experimental-type') === 'module'; } diff --git a/src/node_options.h b/src/node_options.h index f8ffae0aa5015a..f313e7c12b82f2 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -116,8 +116,8 @@ class EnvironmentOptions : public Options { bool experimental_https_modules = false; bool experimental_wasm_modules = false; bool experimental_import_meta_resolve = false; - std::string input_type; - std::string type; + std::string input_type; // Value of --input-type + std::string type; // Value of --experimental-type std::string experimental_policy; std::string experimental_policy_integrity; bool has_policy_integrity_string = false;