From 0ddf73ae7c33188c6b8bfa07705d8a7016d6c7a6 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 20 Feb 2023 11:34:38 +0100 Subject: [PATCH] assert: remove deprecated getFunction() usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 PR-URL: https://github.com/nodejs/node/pull/46661 Reviewed-By: Joyee Cheung Reviewed-By: Michaƫl Zasso Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Ujjwal Sharma Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- 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(