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

Editorial: OrdinaryDefineOwnProperty can't throw for ordinary objects and arrays #3403

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anba
Copy link
Contributor

@anba anba commented Aug 26, 2024

OrdinaryDefineOwnProperty can return an abrupt completion if either O.[[GetOwnProperty]] or IsExtensible(O) returns an abrupt completion. When O is an ordinary object or an array, neither O.[[GetOwnProperty]] nor IsExtensible(O) can return an abrupt completion, therefore OrdinaryDefineOwnProperty is infallible.

@anba anba force-pushed the infallible-ordinary-define-own-prop branch from 6b1a2b5 to 53123e3 Compare August 26, 2024 05:44
… and arrays

`OrdinaryDefineOwnProperty` can return an abrupt completion if either
`O.[[GetOwnProperty]]` or `IsExtensible(O)` returns an abrupt completion. When
`O` is an ordinary object or an array, neither `O.[[GetOwnProperty]]` nor
`IsExtensible(O)` can return an abrupt completion, therefore
`OrdinaryDefineOwnProperty` is infallible.
@anba anba force-pushed the infallible-ordinary-define-own-prop branch from 53123e3 to 72e160c Compare August 26, 2024 05:55
@@ -12671,14 +12671,14 @@ <h1>
[[DefineOwnProperty]] (
_P_: a property key,
_Desc_: a Property Descriptor,
): either a normal completion containing a Boolean or a throw completion
): a Boolean
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
): a Boolean
): a normal completion containing a Boolean

We don't have tooling to enforce it, but we don't allow internal methods to have mixed signatures.

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