| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8666d77 commit 4451460
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -282,7 +282,7 @@ function keyCheck(val1, val2, strict, memos, iterationType, aKeys) { | |||
| 282 | 282 | // Cheap key test | |
| 283 | 283 | let i = 0; | |
| 284 | 284 | for (; i < aKeys.length; i++) { | |
| 285 | - if (!ObjectPrototypeHasOwnProperty(val2, aKeys[i])) { | ||
| 285 | + if (!ObjectPrototypePropertyIsEnumerable(val2, aKeys[i])) { | ||
| 286 | 286 | return false; | |
| 287 | 287 | } | |
| 288 | 288 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1194,3 +1194,13 @@ assert.throws( | |||
| 1194 | 1194 | Object.setPrototypeOf(b, null); | |
| 1195 | 1195 | assertNotDeepOrStrict(a, b, assert.AssertionError); | |
| 1196 | 1196 | } | |
| 1197 | + | ||
| 1198 | + { | ||
| 1199 | + // Verify commutativity | ||
| 1200 | + // Regression test for https://github.com/nodejs/node/issues/37710 | ||
| 1201 | + const a = { x: 1 }; | ||
| 1202 | + const b = { y: 1 }; | ||
| 1203 | + Object.defineProperty(b, 'x', { value: 1 }); | ||
| 1204 | + | ||
| 1205 | + assertNotDeepOrStrict(a, b); | ||
| 1206 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments