-
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: take ToString and ToLength out of StringPad and make it infallible #3066
Conversation
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.
Looks good otherwise. You just need to apply those suggestions where appropriate.
@michaelficarra I've applied your suggestions and thank you for the detailed explanations, the changes make more sense to me now! Also, the original issue suggested that it is |
@dewren99 Normative changes are those that would change the behaviour of some program. This change shouldn't affect the behaviour of any program. All effects occur in the same order and under the same conditions. |
@dewren99 We discussed this in the editor call today. We would like to split out the (mostly) shared implementations of |
@michaelficarra sounds good! I think I understand the overall idea, but it might take a couple of tries for me to get it right. |
@dewren99 That looks good! Names are hard. I'd probably do something like |
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.
lgtm!
spec.html
Outdated
StringPad ( | ||
_S_: a String, | ||
_maxLength_: a non-negative integer, | ||
_fillString_: a String or *undefined*, |
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.
This should just be a String
; the undefined
case should be hoisted into StringPaddingBuiltinsImpl
. Otherwise LGTM; I'll push up a commit with that change so it doesn't need to block.
…fallible (tc39#3066) Co-authored-by: Deniz Eren Evrendilek <devrendilek@gmail.com> Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
…fallible (tc39#3066) Co-authored-by: Deniz Eren Evrendilek <devrendilek@gmail.com> Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
Changed argument types and removed
ToString
andToLength
calls fromStringPad
as per #2634For
maxLength
, I went witha non-negative integer
instead ofa Number
.I'm not sure if the new steps for
String.prototype.padStart
andString.prototype.padEnd
are needed or not.Please let me know if any further changes are needed, thanks!