Skip to content

Commit

Permalink
assert: remove deprecated getFunction() usage
Browse files Browse the repository at this point in the history
The method is meant to be removed by the V8 team. It is not a
critical functionality that is removed, therefore no alternative
is checked for either.

Refs: https://bugs.chromium.org/p/v8/issues/detail?id=9421

Signed-off-by: Ruben Bridgewater <[email protected]>
PR-URL: #46661
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Ujjwal Sharma <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
BridgeAR authored and targos committed Mar 13, 2023
1 parent 6ff0b80 commit a38de61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,7 @@ function getErrMessage(message, fn) {
return;
}
} else {
const fn = call.getFunction();
if (!fn) {
return message;
}
code = String(fn);
identifier = `${code}${line}${column}`;
return message;
}

if (errorCache.has(identifier)) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ assert.throws(
{
code: 'ERR_ASSERTION',
constructor: assert.AssertionError,
message: 'The expression evaluated to a falsy value:\n\n assert(1 === 2)\n'
message: 'false == true'
}
);
assert.throws(
Expand Down

0 comments on commit a38de61

Please sign in to comment.