esm: refine ERR_REQUIRE_ESM errors

PR-URL: https://github.com/nodejs/node/pull/39175
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Guy Bedford authored and Beth Griggs committed 2021-07-29 11:56:44 +01:00
1 parent 9b15e5c155
commit 93eff3f5a6
9 files changed
+182 -63

No files matched your search

+6
View File
@@ -215,6 +215,12 @@ void AppendExceptionLine(Environment* env,
Local<Object> err_obj;
if (!er.IsEmpty() && er->IsObject()) {
err_obj = er.As<Object>();
// If arrow_message is already set, skip.
auto maybe_value = err_obj->GetPrivate(env->context(),
env->arrow_message_private_symbol());
Local<Value> lvalue;
if (!maybe_value.ToLocal(&lvalue) || lvalue->IsString())
return;
}
bool added_exception_line = false;