mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
assert: fix line number calculation after V8 upgrade
PR-URL: https://github.com/nodejs/node/pull/29694 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
This commit is contained in:
parent
1676502318
commit
5981fb7faa
|
|
@ -269,7 +269,7 @@ function getErrMessage(message, fn) {
|
|||
const call = err.stack[0];
|
||||
|
||||
const filename = call.getFileName();
|
||||
const line = call.getLineNumber() - 1;
|
||||
let line = call.getLineNumber() - 1;
|
||||
let column = call.getColumnNumber() - 1;
|
||||
let identifier;
|
||||
let code;
|
||||
|
|
@ -289,6 +289,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}`;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user