GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — assert,util: fix commutativity edge case · nodejs/node@4451460

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/util
    • comparisons.js
  • test/parallel
    • test-assert-deep.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/util/comparisons.js‎

Copy file name to clipboardExpand all lines: lib/internal/util/comparisons.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ function keyCheck(val1, val2, strict, memos, iterationType, aKeys) {
282282
// Cheap key test
283283
let i = 0;
284284
for (; i < aKeys.length; i++) {
285-
if (!ObjectPrototypeHasOwnProperty(val2, aKeys[i])) {
285+
if (!ObjectPrototypePropertyIsEnumerable(val2, aKeys[i])) {
286286
return false;
287287
}
288288
}
Collapse file

‎test/parallel/test-assert-deep.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-assert-deep.js
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,3 +1194,13 @@ assert.throws(
11941194
Object.setPrototypeOf(b, null);
11951195
assertNotDeepOrStrict(a, b, assert.AssertionError);
11961196
}
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+
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.