src: fix bug in GetErrorSource()

Refs: https://github.com/nodejs/node/pull/43875

PR-URL: https://github.com/nodejs/node/pull/44019
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
This commit is contained in:
Tobias Nießen
2022-07-28 08:12:54 +00:00
committed by legendecas
parent 5c50b2053e
commit f2afcad582

View File

@@ -105,7 +105,7 @@ static std::string GetErrorSource(Isolate* isolate,
if (has_source_map_url && env != nullptr && env->source_maps_enabled()) {
std::string source = GetSourceMapErrorSource(
isolate, context, message, added_exception_line);
return added_exception_line ? source : sourceline;
return *added_exception_line ? source : sourceline;
}
// Because of how node modules work, all scripts are wrapped with a