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 <ruben@bridgewater.de>
PR-URL: #46661
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
BridgeAR authored Feb 20, 2023
1 parent 6bc87b7 commit 43c380e
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 43c380e

Please sign in to comment.