Skip to content

Commit

Permalink
assert: fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
targos authored and MylesBorins committed Sep 24, 2019
1 parent ac0ebae commit 2f34d5f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ function getErrMessage(message, fn) {
Error.prepareStackTrace = tmpPrepare;

const filename = call.getFileName();
const line = call.getLineNumber() - 1;
let line = call.getLineNumber() - 1;
let column = call.getColumnNumber() - 1;
let identifier;
let code;
Expand All @@ -287,6 +287,9 @@ function getErrMessage(message, fn) {
return message;
}
code = String(fn);
// For functions created with the Function constructor, V8 does not count
// the lines containing the function header.
line += 2;
identifier = `${code}${line}${column}`;
}

Expand Down

0 comments on commit 2f34d5f

Please sign in to comment.