assert: remove deprecated getFunction() usage

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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Ruben Bridgewater 2023-02-20 11:34:38 +01:00 committed by GitHub
parent 6bc87b71fd
commit 43c380e9b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View File

@ -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)) {

View File

@ -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(