Skip to content

Why is assert_object_equals() failing? #20844

Closed

Activity

  1. AmeliaBR commented on Dec 18, 2019

    @AmeliaBR
    Contributor

    For reference:

    The API description for assert_object_equals:

    asserts that actual is an object and not null and that all enumerable properties on actual are own properties on expected with the same values, recursing if the value is an object and not null.

    And the source code:

    https://github.com/web-platform-tests/wpt/blob/master/resources/testharness.js#L1143-L1177

    As discussed in the linked PR, assert_object_equals is actually unnecessary for this test, where you're testing an identity equality. But… it still shouldn't fail! The same object on both sides should have the same enumerable properties. It's possible the problem is somewhere else in that test, though.

  2. AmeliaBR commented on Dec 18, 2019

    @AmeliaBR
    Contributor

    Looking at the source code, I think the problem is that it's comparing all enumerable properties (for (p in actual)) on one object against own properties on the other ( assert(expected.hasOwnProperty(p),). Enumerable properties include properties from prototype objects.

  3. inexorabletash commented on Feb 21, 2020

    @inexorabletash
    Contributor

    This specific failure (imagebitmap-renderingcontext/context-preserves-canvas.html) was fixed, so closing. The others should be picked off per 2033

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions