Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! module: only emit require(esm) warning under --trace-require-m…
…odule
  • Loading branch information
joyeecheung committed Dec 9, 2024
commit 93516613362d4a618dfdc27aa8bc0bdbe295d38e
3 changes: 1 addition & 2 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors,
errors->push_back("--heapsnapshot-near-heap-limit must not be negative");
}

if (!trace_require_module.empty() &&
trace_require_module != "all" &&
if (!trace_require_module.empty() && trace_require_module != "all" &&
trace_require_module != "no-node-modules") {
errors->push_back("invalid value for --trace-require-module");
}
Expand Down
8 changes: 4 additions & 4 deletions test/es-module/test-require-node-modules-warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spawnSyncAndAssert(
process.execPath,
[
'--trace-require-module=no-node-modules',
fixtures.path('es-modules', 'test_node_modules', 'require-esm.js')
fixtures.path('es-modules', 'test_node_modules', 'require-esm.js'),
],
{
trim: true,
Expand All @@ -31,7 +31,7 @@ spawnSyncAndAssert(
process.execPath,
[
'--trace-require-module=no-node-modules',
fixtures.path('es-modules', 'test_node_modules', 'require-require-esm.js')
fixtures.path('es-modules', 'test_node_modules', 'require-require-esm.js'),
],
{
trim: true,
Expand All @@ -46,7 +46,7 @@ spawnSyncAndAssert(
process.execPath,
[
'--trace-require-module=no-node-modules',
fixtures.path('es-modules', 'test_node_modules', 'import-require-esm.mjs')
fixtures.path('es-modules', 'test_node_modules', 'import-require-esm.mjs'),
],
{
trim: true,
Expand All @@ -61,7 +61,7 @@ spawnSyncAndAssert(
process.execPath,
[
'--trace-require-module=no-node-modules',
fixtures.path('es-modules', 'test_node_modules', 'import-import-require-esm.mjs')
fixtures.path('es-modules', 'test_node_modules', 'import-import-require-esm.mjs'),
],
{
trim: true,
Expand Down