Skip to content

Commit b7b0631

Browse files
Trotttargos
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 <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Harshitha K P <[email protected]>
1 parent ec337b2 commit b7b0631

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
@@ -678,8 +678,7 @@ are recursively evaluated also by the following rules.
678678

679679
### Comparison details
680680

681-
* Primitive values are compared using the [SameValue Comparison][], used by
682-
[`Object.is()`][].
681+
* Primitive values are compared using [`Object.is()`][].
683682
* [Type tags][Object.prototype.toString()] of objects should be the same.
684683
* [`[[Prototype]]`][prototype-spec] of objects are compared using
685684
the [`===` operator][].
@@ -731,7 +730,7 @@ assert.deepStrictEqual(date, fakeDate);
731730
// - Date {}
732731

733732
assert.deepStrictEqual(NaN, NaN);
734-
// OK, because of the SameValue comparison
733+
// OK because Object.is(NaN, NaN) is true.
735734

736735
// Different unwrapped numbers:
737736
assert.deepStrictEqual(new Number(1), new Number(2));
@@ -747,7 +746,7 @@ assert.deepStrictEqual(new String('foo'), Object('foo'));
747746
assert.deepStrictEqual(-0, -0);
748747
// OK
749748

750-
// Different zeros using the SameValue Comparison:
749+
// Different zeros:
751750
assert.deepStrictEqual(0, -0);
752751
// AssertionError: Expected inputs to be strictly deep-equal:
753752
// + actual - expected
@@ -823,7 +822,7 @@ assert.deepStrictEqual(date, fakeDate);
823822
// - Date {}
824823

825824
assert.deepStrictEqual(NaN, NaN);
826-
// OK, because of the SameValue comparison
825+
// OK because Object.is(NaN, NaN) is true.
827826

828827
// Different unwrapped numbers:
829828
assert.deepStrictEqual(new Number(1), new Number(2));
@@ -839,7 +838,7 @@ assert.deepStrictEqual(new String('foo'), Object('foo'));
839838
assert.deepStrictEqual(-0, -0);
840839
// OK
841840

842-
// Different zeros using the SameValue Comparison:
841+
// Different zeros:
843842
assert.deepStrictEqual(0, -0);
844843
// AssertionError: Expected inputs to be strictly deep-equal:
845844
// + actual - expected
@@ -1724,7 +1723,7 @@ changes:
17241723
* `message` {string|Error}
17251724

17261725
Tests strict inequality between the `actual` and `expected` parameters as
1727-
determined by the [SameValue Comparison][].
1726+
determined by [`Object.is()`][].
17281727

17291728
```mjs
17301729
import assert from 'assert/strict';
@@ -2016,7 +2015,7 @@ changes:
20162015
* `message` {string|Error}
20172016

20182017
Tests strict equality between the `actual` and `expected` parameters as
2019-
determined by the [SameValue Comparison][].
2018+
determined by [`Object.is()`][].
20202019

20212020
```mjs
20222021
import assert from 'assert/strict';
@@ -2436,7 +2435,6 @@ argument.
24362435

24372436
[Object wrappers]: https://developer.mozilla.org/en-US/docs/Glossary/Primitive#Primitive_wrapper_objects_in_JavaScript
24382437
[Object.prototype.toString()]: https://tc39.github.io/ecma262/#sec-object.prototype.tostring
2439-
[SameValue Comparison]: https://tc39.github.io/ecma262/#sec-samevalue
24402438
[`!=` operator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality
24412439
[`===` operator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality
24422440
[`==` operator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality

0 commit comments

Comments
 (0)