src: use node:moduleName as builtin module filename

This change allows for easier recognition of builtin modules in stack
traces.

Refs: https://github.com/nodejs/node/issues/11893

PR-URL: https://github.com/nodejs/node/pull/35498
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
This commit is contained in:
Michaël Zasso committed 2020-10-07 17:35:14 +02:00
1 parent 19f14517c7
commit 21782277c2
47 files changed
+306 -304

No files matched your search

+1 -1
View File
@@ -260,7 +260,7 @@ MaybeLocal<Function> NativeModuleLoader::LookupAndCompile(
return {};
}
std::string filename_s = id + std::string(".js");
std::string filename_s = std::string("node:") + id;
Local<String> filename =
OneByteString(isolate, filename_s.c_str(), filename_s.size());
Local<Integer> line_offset = Integer::New(isolate, 0);