Skip to content

Commit e425f36

Browse files
Trottdanielleadams
authored andcommitted
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 <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Harshitha K P <harshitha014@gmail.com>
1 parent 86ece98 commit e425f36

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

doc/api/assert.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,7 @@ are recursively evaluated also by the following rules.
676676

677677
### Comparison details
678678

679-
* Primitive values are compared using the [SameValue Comparison][], used by
680-
[`Object.is()`][].
679+
* Primitive values are compared using [`Object.is()`][].
681680
* [Type tags][Object.prototype.toString()] of objects should be the same.
682681
* [`[[Prototype]]`][prototype-spec] of objects are compared using
683682
the [`===` operator][].
@@ -729,7 +728,7 @@ assert.deepStrictEqual(date, fakeDate);
729728
// - Date {}
730729

731730
assert.deepStrictEqual(NaN, NaN);
732-
// OK, because of the SameValue comparison
731+
// OK because Object.is(NaN, NaN) is true.
733732

734733
// Different unwrapped numbers:
735734
assert.deepStrictEqual(new Number(1), new Number(2));
@@ -745,7 +744,7 @@ assert.deepStrictEqual(new String('foo'), Object('foo'));
745744
assert.deepStrictEqual(-0, -0);
746745
// OK
747746

748-
// Different zeros using the SameValue Comparison:
747+
// Different zeros:
749748
assert.deepStrictEqual(0, -0);
750749
// AssertionError: Expected inputs to be strictly deep-equal:
751750
// + actual - expected
@@ -821,7 +820,7 @@ assert.deepStrictEqual(date, fakeDate);
821820
// - Date {}
822821

823822
assert.deepStrictEqual(NaN, NaN);
824-
// OK, because of the SameValue comparison
823+
// OK because Object.is(NaN, NaN) is true.
825824

826825
// Different unwrapped numbers:
827826
assert.deepStrictEqual(new Number(1), new Number(2));
@@ -837,7 +836,7 @@ assert.deepStrictEqual(new String('foo'), Object('foo'));
837836
assert.deepStrictEqual(-0, -0);
838837
// OK
839838

840-
// Different zeros using the SameValue Comparison:
839+
// Different zeros:
841840
assert.deepStrictEqual(0, -0);
842841
// AssertionError: Expected inputs to be strictly deep-equal:
843842
// + actual - expected
@@ -1716,7 +1715,7 @@ changes:
17161715
* `message` {string|Error}
17171716

17181717
Tests strict inequality between the `actual` and `expected` parameters as
1719-
determined by the [SameValue Comparison][].
1718+
determined by [`Object.is()`][].
17201719

17211720
```mjs
17221721
import assert from 'assert/strict';
@@ -2008,7 +2007,7 @@ changes:
20082007
* `message` {string|Error}
20092008

20102009
Tests strict equality between the `actual` and `expected` parameters as
2011-
determined by the [SameValue Comparison][].
2010+
determined by [`Object.is()`][].
20122011

20132012
```mjs
20142013
import assert from 'assert/strict';
@@ -2428,7 +2427,6 @@ argument.
24282427

24292428
[Object wrappers]: https://developer.mozilla.org/en-US/docs/Glossary/Primitive#Primitive_wrapper_objects_in_JavaScript
24302429
[Object.prototype.toString()]: https://tc39.github.io/ecma262/#sec-object.prototype.tostring
2431-
[SameValue Comparison]: https://tc39.github.io/ecma262/#sec-samevalue
24322430
[`!=` operator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality
24332431
[`===` operator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality
24342432
[`==` operator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality

0 commit comments

Comments
 (0)