| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1050,6 +1050,21 @@ assert.throws( | |||
| 1050 | 1050 | assert.deepStrictEqual(a, b); | |
| 1051 | 1051 | } | |
| 1052 | 1052 | ||
| 1053 | + // Verify that an array and the equivalent fake array object | ||
| 1054 | + // are correctly compared | ||
| 1055 | + { | ||
| 1056 | + const a = [1, 2, 3]; | ||
| 1057 | + const o = { | ||
| 1058 | + __proto__: Array.prototype, | ||
| 1059 | + 0: 1, | ||
| 1060 | + 1: 2, | ||
| 1061 | + 2: 3, | ||
| 1062 | + length: 3, | ||
| 1063 | + }; | ||
| 1064 | + Object.defineProperty(o, 'length', { enumerable: false }); | ||
| 1065 | + assertNotDeepOrStrict(o, a); | ||
| 1066 | + } | ||
| 1067 | + | ||
| 1053 | 1068 | // Verify that extra keys will be tested for when using fake arrays. | |
| 1054 | 1069 | { | |
| 1055 | 1070 | const a = { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments