MCPcopy Index your code
hub / github.com/nodejs/node / check_equal

Function check_equal

test/fixtures/wpt/resources/testharness.js:1658–1683  ·  view source on GitHub ↗
(actual, expected, stack)

Source from the content-addressed store, hash-verified

1656 {actual: actual});
1657 //This needs to be improved a great deal
1658 function check_equal(actual, expected, stack)
1659 {
1660 stack.push(actual);
1661
1662 var p;
1663 for (p in actual) {
1664 assert(expected.hasOwnProperty(p), "assert_object_equals", description,
1665 "unexpected property ${p}", {p:p});
1666
1667 if (typeof actual[p] === "object" && actual[p] !== null) {
1668 if (stack.indexOf(actual[p]) === -1) {
1669 check_equal(actual[p], expected[p], stack);
1670 }
1671 } else {
1672 assert(same_value(actual[p], expected[p]), "assert_object_equals", description,
1673 "property ${p} expected ${expected} got ${actual}",
1674 {p:p, expected:expected[p], actual:actual[p]});
1675 }
1676 }
1677 for (p in expected) {
1678 assert(actual.hasOwnProperty(p),
1679 "assert_object_equals", description,
1680 "expected property ${p} missing", {p:p});
1681 }
1682 stack.pop();
1683 }
1684 check_equal(actual, expected, []);
1685 }
1686 expose_assert(assert_object_equals, "assert_object_equals");

Callers 1

assert_object_equalsFunction · 0.70

Calls 6

popMethod · 0.80
assertFunction · 0.70
same_valueFunction · 0.70
pushMethod · 0.45
hasOwnPropertyMethod · 0.45
indexOfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…