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: Use CreateDataPropertyOrThrow abstract op in more places #1359

Merged

Conversation

shvaikalesh
Copy link
Contributor

@shvaikalesh shvaikalesh commented Sep 10, 2023

A step like ! CreateDataProperty(...) asserts only that [[DefineOwnProperty]] is an ordinary method that can't throw, but doesn't assert that property creation is a guaranteed success because [[DefineOwnProperty]] only returns boolean status (it is Object.defineProperty that throws a TypeError).

This change replaces these steps with ! CreateDataPropertyOrThrow(...), asserting that property is defined successfully since all its call sites operate on newly-created objects with no non-configurable properties.

ECMA-262 has no occurrences of ! CreateDataProperty(...).

Also, this change replaces "Call" with "Perform", which is a new convention of ECMA-262.


Preview | Diff

@domenic
Copy link
Member

domenic commented Sep 10, 2023

@shvaikalesh
Copy link
Contributor Author

shvaikalesh commented Sep 10, 2023

@domenic Oh no, https://whatpr.org/webidl/1359.html#ref-for-sec-createdataproperty asserts on the result, so it's semantically equivalent to ! CreateDataPropertyOrThrow(...), while for https://whatpr.org/webidl/1359.html#ref-for-sec-createdataproperty%E2%91%A0 I have a different change in mind: #1360.

@domenic domenic merged commit eb32e3e into whatwg:main Sep 10, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants