Skip to content

Commit 0ddf73a

Browse files
BridgeARdanielleadams
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 <[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]>
1 parent 3714d8f commit 0ddf73a

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

lib/assert.js

+1-6
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

+1-1
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)