From 74ff4a7533bc9e1aab640d132869f0b250678dad Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 11 Aug 2025 19:27:58 -0400 Subject: [PATCH] assert,util: fail promise comparison in deep equal checks It is impossible to look into the content of a promise and its state. This aligns the comparison with WeakMaps and WeakSets. Only reference equal promises will pass the check in the future. Fixes https://github.com/nodejs/node/issues/55198 --- doc/api/assert.md | 34 ++++++++++++++++++++++--------- lib/internal/util/comparisons.js | 23 +++++++++++---------- test/parallel/test-assert-deep.js | 7 +++++++ 3 files changed, 43 insertions(+), 21 deletions(-) diff --git a/doc/api/assert.md b/doc/api/assert.md index e7b21b58b28208..a9f43ce17e8a75 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -278,6 +278,10 @@ An alias of [`assert.ok()`][].