You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getters are for querying internal state; if there's nothing "internal" about it, a data property seems more idiomatic to me.
The argument makes sense for range proposal. The API is designed to be immutable so it's not possible to change step, start, end. Since there is no internal state, it's better to use its own properties.
Helper methods on the iterator prototype: Will be affected if they're rely on the options. This will also give up the brand check so a future helper method can work on non-range-iterator objects.
// slot+getterrange.includes(2)// impossible to change range.start/endrange.includes.call({start:0,end:5})// throws// own propertyrange.includes(2)// possible to re-configure start/end to change the resultrange.includes.call({start: 0,end: 5},2)// ok
maybe @erights interested in this (I do want to avoid any new internal slots)
The text was updated successfully, but these errors were encountered:
tc39/proposal-promise-any#38
@jorendorff writes:
The argument makes sense for range proposal. The API is designed to be immutable so it's not possible to change
step
,start
,end
. Since there is no internal state, it's better to use its own properties.What if the developer re-configure the options?
Current spec: Will change the number emitted, but after moving to the build-in generator(Editorial: Add Yield, CreateIteratorFromClosure, CreateAsyncIteratorFromClosure abs op. ecma262#2045), the options will be carried in the abstract closures so it's not breaking.
Helper methods on the iterator prototype: Will be affected if they're rely on the options. This will also give up the brand check so a future helper method can work on non-range-iterator objects.
maybe @erights interested in this (
I do want to avoid any new internal slots
)The text was updated successfully, but these errors were encountered: