Skip to content

Commit

Permalink
src: print native module id on native module not found
Browse files Browse the repository at this point in the history
To help core contributors identify which file is missing from the build.

PR-URL: #39460
Refs: #39408
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Zeyu Yang <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
legendecas authored and targos committed Sep 4, 2021
1 parent 83f5cc0 commit 985ec48
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/node_native_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ MaybeLocal<String> NativeModuleLoader::LoadBuiltinModuleSource(Isolate* isolate,
isolate, contents.c_str(), v8::NewStringType::kNormal, contents.length());
#else
const auto source_it = source_.find(id);
CHECK_NE(source_it, source_.end());
if (UNLIKELY(source_it == source_.end())) {
fprintf(stderr, "Cannot find native builtin: \"%s\".\n", id);
ABORT();
}
return source_it->second.ToStringChecked(isolate);
#endif // NODE_BUILTIN_MODULES_PATH
}
Expand Down

0 comments on commit 985ec48

Please sign in to comment.