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;