Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPT: Fix bogus use of assert_object_equals() #21911

Merged
merged 1 commit into from Feb 21, 2020

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Feb 20, 2020

This test was converted from js-test.js to testharness.js in
https://crrev.com/625734 and incorrectly used assert_object_equals.

  • assert_object_equals() will assert that enumerable properties are
    the same. Since new Number(42) doesn't have any own properties,
    nothing useful was actually being asserted!
  • assert_equals() is sufficient for an object identity test.
  • The original test used new Number(42) to mint an object that would
    serialize as something distinct. This isn't necessary with
    testharness.js assertions - using {} is good enough.

assert_object_equals() has lots of non-intuitive behavior, see
#2033 for more.

Change-Id: I202f27c228c7ec65407d9eae724af21181e6e684
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067565
Auto-Submit: Joshua Bell <jsbell@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743523}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

This test was converted from js-test.js to testharness.js in
https://crrev.com/625734 and incorrectly used assert_object_equals.

* assert_object_equals() will assert that enumerable properties are
  the same. Since `new Number(42)` doesn't have any own properties,
  nothing useful was actually being asserted!
* assert_equals() is sufficient for an object identity test.
* The original test used `new Number(42)` to mint an object that would
  serialize as something distinct. This isn't necessary with
  testharness.js assertions - using {} is good enough.

assert_object_equals() has lots of non-intuitive behavior, see
#2033 for more.

Change-Id: I202f27c228c7ec65407d9eae724af21181e6e684
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067565
Auto-Submit: Joshua Bell <jsbell@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743523}
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 9202fb0 into master Feb 21, 2020
@foolip foolip deleted the chromium-export-cl-2067565 branch May 26, 2020 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants