| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 86ece98 commit e425f36
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -676,8 +676,7 @@ are recursively evaluated also by the following rules. | |||
| 676 | 676 | ||
| 677 | 677 | ### Comparison details | |
| 678 | 678 | ||
| 679 | - * Primitive values are compared using the [SameValue Comparison][], used by | ||
| 680 | - [`Object.is()`][]. | ||
| 679 | + * Primitive values are compared using [`Object.is()`][]. | ||
| 681 | 680 | * [Type tags][Object.prototype.toString()] of objects should be the same. | |
| 682 | 681 | * [`[[Prototype]]`][prototype-spec] of objects are compared using | |
| 683 | 682 | the [`===` operator][]. | |
@@ -729,7 +728,7 @@ assert.deepStrictEqual(date, fakeDate); | |||
| 729 | 728 | // - Date {} | |
| 730 | 729 | ||
| 731 | 730 | assert.deepStrictEqual(NaN, NaN); | |
| 732 | - // OK, because of the SameValue comparison | ||
| 731 | + // OK because Object.is(NaN, NaN) is true. | ||
| 733 | 732 | ||
| 734 | 733 | // Different unwrapped numbers: | |
| 735 | 734 | assert.deepStrictEqual(new Number(1), new Number(2)); | |
@@ -745,7 +744,7 @@ assert.deepStrictEqual(new String('foo'), Object('foo')); | |||
| 745 | 744 | assert.deepStrictEqual(-0, -0); | |
| 746 | 745 | // OK | |
| 747 | 746 | ||
| 748 | - // Different zeros using the SameValue Comparison: | ||
| 747 | + // Different zeros: | ||
| 749 | 748 | assert.deepStrictEqual(0, -0); | |
| 750 | 749 | // AssertionError: Expected inputs to be strictly deep-equal: | |
| 751 | 750 | // + actual - expected | |
@@ -821,7 +820,7 @@ assert.deepStrictEqual(date, fakeDate); | |||
| 821 | 820 | // - Date {} | |
| 822 | 821 | ||
| 823 | 822 | assert.deepStrictEqual(NaN, NaN); | |
| 824 | - // OK, because of the SameValue comparison | ||
| 823 | + // OK because Object.is(NaN, NaN) is true. | ||
| 825 | 824 | ||
| 826 | 825 | // Different unwrapped numbers: | |
| 827 | 826 | assert.deepStrictEqual(new Number(1), new Number(2)); | |
@@ -837,7 +836,7 @@ assert.deepStrictEqual(new String('foo'), Object('foo')); | |||
| 837 | 836 | assert.deepStrictEqual(-0, -0); | |
| 838 | 837 | // OK | |
| 839 | 838 | ||
| 840 | - // Different zeros using the SameValue Comparison: | ||
| 839 | + // Different zeros: | ||
| 841 | 840 | assert.deepStrictEqual(0, -0); | |
| 842 | 841 | // AssertionError: Expected inputs to be strictly deep-equal: | |
| 843 | 842 | // + actual - expected | |
@@ -1716,7 +1715,7 @@ changes: | |||
| 1716 | 1715 | * `message` {string|Error} | |
| 1717 | 1716 | ||
| 1718 | 1717 | Tests strict inequality between the `actual` and `expected` parameters as | |
| 1719 | - determined by the [SameValue Comparison][]. | ||
| 1718 | + determined by [`Object.is()`][]. | ||
| 1720 | 1719 | ||
| 1721 | 1720 | ```mjs | |
| 1722 | 1721 | import assert from 'assert/strict'; | |
@@ -2008,7 +2007,7 @@ changes: | |||
| 2008 | 2007 | * `message` {string|Error} | |
| 2009 | 2008 | ||
| 2010 | 2009 | Tests strict equality between the `actual` and `expected` parameters as | |
| 2011 | - determined by the [SameValue Comparison][]. | ||
| 2010 | + determined by [`Object.is()`][]. | ||
| 2012 | 2011 | ||
| 2013 | 2012 | ```mjs | |
| 2014 | 2013 | import assert from 'assert/strict'; | |
@@ -2428,7 +2427,6 @@ argument. | |||
| 2428 | 2427 | ||
| 2429 | 2428 | [Object wrappers]: https://developer.mozilla.org/en-US/docs/Glossary/Primitive#Primitive_wrapper_objects_in_JavaScript | |
| 2430 | 2429 | [Object.prototype.toString()]: https://tc39.github.io/ecma262/#sec-object.prototype.tostring | |
| 2431 | - [SameValue Comparison]: https://tc39.github.io/ecma262/#sec-samevalue | ||
| 2432 | 2430 | [`!=` operator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality | |
| 2433 | 2431 | [`===` operator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality | |
| 2434 | 2432 | [`==` operator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality | |
| Back | FazBrowse Home | New Git URL |
0 commit comments