-
Notifications
You must be signed in to change notification settings - Fork 13
Conversation
README.md
Outdated
@@ -47,7 +47,7 @@ When the SetLastArrayItem method is called, the following steps are taken: | |||
|
|||
Let O be ? ToObject(this value). | |||
Let len be ? ToLength(? Get(O, "length")). | |||
If len is zeo, then | |||
If len is not zero, then |
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.
maybe > 0
?
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.
🤷♂️, how does the rest of the spec handle it? Isn't "zero or positive" implied by ToLength
?
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.
good point. I think it is, but I think that making implications explicit might still be helpful.
- https://tc39.github.io/ecma262/#sec-string.raw uses
<= 0
- https://tc39.github.io/ecma262/#sec-array.prototype.includes uses
is 0
- https://tc39.github.io/ecma262/#sec-array.prototype.indexof uses
is 0
- https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof uses
is 0
- https://tc39.github.io/ecma262/#sec-array.prototype.pop uses
is zero
- https://tc39.github.io/ecma262/#sec-array.prototype.reduce uses
is 0
- https://tc39.github.io/ecma262/#sec-array.prototype.reduceright uses
is 0
- https://tc39.github.io/ecma262/#sec-array.prototype.shift uses
is zero
All the other use cases I found were part of a more generic algorithm, like a loop.
Sounds like is 0
is the overarching convention. I'll make a PR to convert the remainder in the spec.
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.
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.
Updated.
Thanks both 👍 ❤️ |
No description provided.