Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

add missing ! on CreateDataProperty #16

Merged
merged 2 commits into from
Jul 20, 2019
Merged

add missing ! on CreateDataProperty #16

merged 2 commits into from
Jul 20, 2019

Conversation

ljharb
Copy link
Member

@ljharb ljharb commented Jul 20, 2019

No description provided.

@ljharb ljharb mentioned this pull request Jul 20, 2019
3 tasks
@@ -34,7 +34,7 @@ <h1><ins>FromMatchOptions ( _Options_ )</ins></h1>
1. Assert: _Options_ is a MatchOptions Record.
1. Let _obj_ be ObjectCreate(%ObjectPrototype%).
1. Assert: _obj_ is an extensible ordinary object with no own properties.
1. Perform CreateDataProperty(_obj_, `"capture"`, _Options_.[[Capture]]).
1. Perform ! CreateDataProperty(_obj_, `"capture"`, _Options_.[[Capture]]).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it better to do ! CreateDataProperty and then later Assert that it returns true, or do ! CreateDataPropertyOrThrow, which basically combines both?

Copy link
Member Author

Choose a reason for hiding this comment

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

The latter seems much better, good call!

Copy link
Collaborator

Choose a reason for hiding this comment

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

I've seen both used that way in the spec, so there may be places calling ! CreateDataProperty and not checking for true currently.

@rbuckton rbuckton merged commit 6e921db into master Jul 20, 2019
@rbuckton rbuckton deleted the ljharb-patch-1 branch July 20, 2019 07:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants