-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: Add new convention for abstract ops that don't throw #256
Conversation
@@ -13851,7 +13848,7 @@ | |||
1. Let _nextValue_ be IteratorValue(_next_). | |||
1. If _nextValue_ is an abrupt completion, set _iteratorRecord_.[[done]] to *true*. | |||
1. ReturnIfAbrupt(_nextValue_). | |||
1. Let _status_ be CreateDataProperty(_A_, ToString(_n_), _nextValue_). | |||
1. Let _status_ be CreateDataProperty(_A_, ! ToString(_n_), _nextValue_). |
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.
should CreateDataProperty
have a ?
or a !
in front of it?
@@ -7476,7 +7474,7 @@ | |||
1. If _succeeded_ is *false*, return *false*. | |||
1. While _newLen_ < _oldLen_ repeat, | |||
1. Set _oldLen_ to _oldLen_ - 1. | |||
1. Let _deleteSucceeded_ be _A_.[[Delete]](ToString(_oldLen_)). | |||
1. Let _deleteSucceeded_ be _A_.[[Delete]](! ToString(_oldLen_)). | |||
1. Assert: _deleteSucceeded_ is not an abrupt completion. |
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.
add prefix on [[Delete]]
, and remove this line?
k sorry, i'll stop - we should probably check all the |
Agreed, I don't think any of my comments should block this change, just cleanups that might be missed later if not caught now :-) this is a huge improvement imo. |
This PR isn't trying to be exhaustive :) Landing this now, please send PRs for all the others as you come across them! Committed as 166ab2b (rebased, fixed merge conflicts). |
…vor of ? / ! prefixes. From tc39#256 (comment)
Fixing all remaining issues will be a tedious work. I think it's only fair the proponents of the
Reference type:
Declarative Environment Record:
Other operations:
|
As discussed in #253. Thoughts on this? I personally find this easier to read.
I've also gone ahead and added ! to a few places where it is needed (mostly ToString invocations). The next biggest class of calls that can't fail are to Type and min/max/friends. Since these can never throw by definition I wonder if it's worth adding ! in these types of cases. I'm leaning toward not on the grounds that Type is a short-hand and min/max/etc. are math functions and so neither actually returns a completion record... Thoughts?