-
Notifications
You must be signed in to change notification settings - Fork 452
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
Add tests for Object.hasOwn #2995
Conversation
Co-authored-by: Jordan Harband <ljharb@gmail.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might have missed it while reading the tests, but I think we are not testing the property descriptor of Object.hasOwn
(something like https://github.com/tc39/test262/blob/main/test/built-ins/Object/assign/assign-descriptor.js).
@nicolo-ribaudo nope didn't have that, added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing these tests, Jamie!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot of test material here, which I generally really appreciate, but there are things being tested that aren't relevant to property "own"-ness.
test/built-ins/Object/hasOwn/hasown_inherited_getter_and_setter.js
Outdated
Show resolved
Hide resolved
I copied I think all of these tests from test/built-ins/Object/prototype/hasOwnProperty, I'm not entirely sure which ones should be removed. |
Well, then it seems that directory is filled with tests that are irrelevant to "own"-ness. We can deal with that later. |
Everyone that's reviewed should come back and resolve or re-review for @jamiebuilds |
Pinging this, in the hopes that it gets the reviews updated. @jugglinmike i think yours is the only request changes rn? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're close! It just looks like a couple small bugs slipped in through the latest refactoring.
Okay @jugglinmike I've updated those test cases, this should now be good to go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Nice work :)
By the way, the CI failures are about failing tests. We recently configured the system to tolerate test failures, so my guess is that this was caused by the base branch being behind the upstream main
branch.
Proposal: https://github.com/tc39/proposal-accessible-object-hasownproperty
This proposal just reached stage 3, its not currently published in the draft but I've used
esid: sec-object.hasown
since that's what it's very likely going to end up being.This PR is largely a copy-and-paste job from the old
Object.prototype.hasOwnProperty
tests, but I've tried to modernize anything I can.