Skip to content

Commit 25d0fbf

Browse files
authored
doc: remove SameValue comparison reference
Referring to `Object.is()` will be more clear and direct. The `Object.is()` reference in turn refers to `SameValue` so people can dig deeper there if they want or need to. PR-URL: #41460 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Harshitha K P <[email protected]>
1 parent 500241d commit 25d0fbf

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

doc/api/assert.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,7 @@ are recursively evaluated also by the following rules.
686686

687687
### Comparison details
688688

689-
* Primitive values are compared using the [SameValue Comparison][], used by
690-
[`Object.is()`][].
689+
* Primitive values are compared using [`Object.is()`][].
691690
* [Type tags][Object.prototype.toString()] of objects should be the same.
692691
* [`[[Prototype]]`][prototype-spec] of objects are compared using
693692
the [`===` operator][].
@@ -741,7 +740,7 @@ assert.deepStrictEqual(date, fakeDate);
741740
// - Date {}
742741

743742
assert.deepStrictEqual(NaN, NaN);
744-
// OK, because of the SameValue comparison
743+
// OK because Object.is(NaN, NaN) is true.
745744

746745
// Different unwrapped numbers:
747746
assert.deepStrictEqual(new Number(1), new Number(2));
@@ -757,7 +756,7 @@ assert.deepStrictEqual(new String('foo'), Object('foo'));
757756
assert.deepStrictEqual(-0, -0);
758757
// OK
759758

760-
// Different zeros using the SameValue Comparison:
759+
// Different zeros:
761760
assert.deepStrictEqual(0, -0);
762761
// AssertionError: Expected inputs to be strictly deep-equal:
763762
// + actual - expected
@@ -833,7 +832,7 @@ assert.deepStrictEqual(date, fakeDate);
833832
// - Date {}
834833

835834
assert.deepStrictEqual(NaN, NaN);
836-
// OK, because of the SameValue comparison
835+
// OK because Object.is(NaN, NaN) is true.
837836

838837
// Different unwrapped numbers:
839838
assert.deepStrictEqual(new Number(1), new Number(2));
@@ -849,7 +848,7 @@ assert.deepStrictEqual(new String('foo'), Object('foo'));
849848
assert.deepStrictEqual(-0, -0);
850849
// OK
851850

852-
// Different zeros using the SameValue Comparison:
851+
// Different zeros:
853852
assert.deepStrictEqual(0, -0);
854853
// AssertionError: Expected inputs to be strictly deep-equal:
855854
// + actual - expected
@@ -1734,7 +1733,7 @@ changes:
17341733
* `message` {string|Error}
17351734

17361735
Tests strict inequality between the `actual` and `expected` parameters as
1737-
determined by the [SameValue Comparison][].
1736+
determined by [`Object.is()`][].
17381737

17391738
```mjs
17401739
import assert from 'assert/strict';
@@ -2026,7 +2025,7 @@ changes:
20262025
* `message` {string|Error}
20272026

20282027
Tests strict equality between the `actual` and `expected` parameters as
2029-
determined by the [SameValue Comparison][].
2028+
determined by [`Object.is()`][].
20302029

20312030
```mjs
20322031
import assert from 'assert/strict';
@@ -2446,7 +2445,6 @@ argument.
24462445

24472446
[Object wrappers]: https://developer.mozilla.org/en-US/docs/Glossary/Primitive#Primitive_wrapper_objects_in_JavaScript
24482447
[Object.prototype.toString()]: https://tc39.github.io/ecma262/#sec-object.prototype.tostring
2449-
[SameValue Comparison]: https://tc39.github.io/ecma262/#sec-samevalue
24502448
[`!=` operator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality
24512449
[`===` operator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality
24522450
[`==` operator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality

0 commit comments

Comments
 (0)