Skip to content

Commit

Permalink
Provide placeholder names for anonymous functions
Browse files Browse the repository at this point in the history
  • Loading branch information
fongandrew committed Sep 11, 2017
1 parent 698f197 commit 32faf70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,13 @@ Test.prototype._assert = function assert (ok, opts) {
if (filem[1].slice(0, dir.length) === dir) {
continue;
}
res.functionName = s[0];

res.functionName = s.length > 1 ? s[0] : '<anonymous>';
res.file = filem[1];
res.line = Number(filem[2]);
if (filem[3]) res.column = filem[3];

res.at = m[1];
res.at = s.length > 1 ? m[1] : '<anonymous> (' + m[1] + ')';
break;
}
}
Expand Down

0 comments on commit 32faf70

Please sign in to comment.