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