vm: hint module identifier in instantiate errors

PR-URL: https://github.com/nodejs/node/pull/60199
Fixes: https://github.com/nodejs/node/issues/60157
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Chengzhong Wu authored and GitHub committed 2025-10-12 14:28:56 +00:00
1 parent d54e6aec9e
commit 1986ee4b65
4 files changed
+28 -17

No files matched your search

+3 -4
View File
@@ -295,12 +295,11 @@ inline v8::Local<v8::Object> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {
}
inline void THROW_ERR_SOURCE_PHASE_NOT_DEFINED(v8::Isolate* isolate,
v8::Local<v8::String> url) {
std::string message = std::string(*v8::String::Utf8Value(isolate, url));
const std::string& url) {
return THROW_ERR_SOURCE_PHASE_NOT_DEFINED(
isolate,
"Source phase import object is not defined for module %s",
message.c_str());
"Source phase import object is not defined for module '%s'",
url);
}
inline v8::Local<v8::Object> ERR_STRING_TOO_LONG(v8::Isolate* isolate) {