Skip to content

Commit a38de61

Browse files
BridgeARtargos
authored andcommitted
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: #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>
1 parent 6ff0b80 commit a38de61

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

lib/assert.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,7 @@ function getErrMessage(message, fn) {
308308
return;
309309
}
310310
} else {
311-
const fn = call.getFunction();
312-
if (!fn) {
313-
return message;
314-
}
315-
code = String(fn);
316-
identifier = `${code}${line}${column}`;
311+
return message;
317312
}
318313

319314
if (errorCache.has(identifier)) {

test/parallel/test-assert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ assert.throws(
921921
{
922922
code: 'ERR_ASSERTION',
923923
constructor: assert.AssertionError,
924-
message: 'The expression evaluated to a falsy value:\n\n assert(1 === 2)\n'
924+
message: 'false == true'
925925
}
926926
);
927927
assert.throws(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy