Skip to content

Implement Object.hasOwn #163

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

Merged
merged 8 commits into from
Jun 17, 2021
Merged

Implement Object.hasOwn #163

merged 8 commits into from
Jun 17, 2021

Conversation

jamiebuilds
Copy link
Contributor

@jamiebuilds jamiebuilds commented May 26, 2021

This proposal just reached stage 3: https://github.com/tc39/proposal-accessible-object-hasownproperty

Spec: https://tc39.es/proposal-accessible-object-hasownproperty/

Object.hasOwn ( O, P )

When the hasOwn method is called, the following steps are taken:

  1. Let obj be ? ToObject(O).
  2. Let key be ? ToPropertyKey(P).
  3. Return ? HasOwnProperty(obj, key).

@devsnek
Copy link
Member

devsnek commented May 26, 2021

Thanks for the PR! One thing to note is that features in engine262 are flagged until they reach stage 4. You can do that by adding the feature to engine.mjs and then changing ['hasOwn', Object_hasOwn, 2], to

    surroundingAgent.feature('whatever')
      ? ['hasOwn', Object_hasOwn, 2]
      : undefined,

If we also wait for your test PR to land, you can add the feature to test/test262/features

@jamiebuilds
Copy link
Contributor Author

If we also wait for your test PR to land, you can add the feature to test/test262/features

The test262 tests have landed and I've updated this PR to add it to the features list.

@devsnek
Copy link
Member

devsnek commented Jun 17, 2021

@jamiebuilds i pulled the latest test262 into main. if you rebase and enable the feature it should be good to go.

@jamiebuilds
Copy link
Contributor Author

@devsnek Updated

@devsnek devsnek merged commit 9193f9e into engine262:main Jun 17, 2021
@jamiebuilds jamiebuilds deleted the object-hasown branch June 17, 2021 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants