From e4865f5403e7d6dd82bef44bc410b0e96fa387d5 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Wed, 15 Feb 2023 00:06:56 +0100 Subject: [PATCH] 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 --- lib/assert.js | 7 +------ test/parallel/test-assert.js | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/assert.js b/lib/assert.js index 93b80088ec222a..f200507ad60537 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -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)) { diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 24a72091c08399..0a270d030feea6 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -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(