From 45ae52fc2b4d39b141e610e26da0641acb8fd1f7 Mon Sep 17 00:00:00 2001 From: Hamza <119741344+hamzakargin@users.noreply.github.com> Date: Tue, 14 Oct 2025 15:37:31 +0300 Subject: [PATCH 1/2] doc: mention constructor comparison in assert.deepStrictEqual Updated `assert.deepStrictEqual` docs to explicitly mention that object constructors are included in the comparison. This clarifies behavior consistent with `util.isDeepStrictEqual` and helps prevent confusion when comparing derived objects or proxy instances. --- doc/api/assert.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/assert.md b/doc/api/assert.md index e52b9b57c2b43a..0cb42902357e4f 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -399,6 +399,8 @@ are also recursively evaluated by the following rules. both sides are {NaN}. * [Type tags][Object.prototype.toString()] of objects should be the same. * Only [enumerable "own" properties][] are considered. +* Object constructors are also compared to ensure that instances are strictly deep-equal. + This means that even if two objects share the same prototype and properties, differing constructors will result in inequality. * {Error} names, messages, causes, and errors are always compared, even if these are not enumerable properties. * [Object wrappers][] are compared both as objects and unwrapped values. From c5a93e8bc4d6f862a374e2f3f8647a0527a8eaa0 Mon Sep 17 00:00:00 2001 From: Hamza <119741344+hamzakargin@users.noreply.github.com> Date: Tue, 21 Oct 2025 20:38:07 +0300 Subject: [PATCH 2/2] doc: simplify constructor comparison wording --- doc/api/assert.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/api/assert.md b/doc/api/assert.md index 0cb42902357e4f..a57c067820589b 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -399,8 +399,7 @@ are also recursively evaluated by the following rules. both sides are {NaN}. * [Type tags][Object.prototype.toString()] of objects should be the same. * Only [enumerable "own" properties][] are considered. -* Object constructors are also compared to ensure that instances are strictly deep-equal. - This means that even if two objects share the same prototype and properties, differing constructors will result in inequality. +* Object constructors are compared when available. * {Error} names, messages, causes, and errors are always compared, even if these are not enumerable properties. * [Object wrappers][] are compared both as objects and unwrapped values.