Skip to content

Commit 38126ee

Browse files
committed
test_runner: assert entry is a valid object
1 parent cebf21d commit 38126ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/test_runner/test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const {
1414
Number,
1515
NumberPrototypeToFixed,
1616
ObjectDefineProperty,
17+
ObjectKeys,
1718
ObjectSeal,
1819
Promise,
1920
PromisePrototypeThen,
@@ -560,7 +561,7 @@ class Test extends AsyncResource {
560561
const map = lazyFindSourceMap(this.loc.file);
561562
const entry = map?.findEntry(this.loc.line - 1, this.loc.column - 1);
562563

563-
if (entry !== undefined) {
564+
if (entry !== undefined && ObjectKeys(entry).length > 0) {
564565
this.loc.line = entry.originalLine + 1;
565566
this.loc.column = entry.originalColumn + 1;
566567
this.loc.file = entry.originalSource;

0 commit comments

Comments
 (0)