Skip to content
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

Per May 2016 TC39 consensus, `String#{padStart,padEnd}` is now stage 4! #581

Merged
merged 1 commit into from Jun 1, 2016

Conversation

Projects
None yet
4 participants
@ljharb
Copy link
Member

ljharb commented May 25, 2016

@ljharb ljharb referenced this pull request May 25, 2016

Closed

Path to Stage 4! #23

13 of 13 tasks complete
spec.html Outdated
1. Let _O_ be ? RequireObjectCoercible(*this* value).
1. Let _S_ be ? ToString(_O_).
1. Let _intMaxLength_ be ? ToLength(_maxLength_).
1. Let _stringLength_ be the number of elements in S.

This comment has been minimized.

Copy link
@annevk

annevk May 25, 2016

Member

S -> S

This comment has been minimized.

Copy link
@ljharb

ljharb May 25, 2016

Author Member

whoops, thanks!

@ljharb ljharb force-pushed the ljharb:string-padstart branch from 586e037 to 8148b68 May 25, 2016

spec.html Outdated
1. Let _intMaxLength_ be ? ToLength(_maxLength_).
1. Let _stringLength_ be the number of elements in S.
1. If _intMaxLength_ is not greater than _stringLength_, return _S_.
1. If _fillString_ is *undefined*, let _filler_ be a string consisting solely of the code unit U+0020 (SPACE).

This comment has been minimized.

Copy link
@annevk

annevk May 25, 2016

Member

The draft consistently uses U+ notation with code point or character, not code unit. Also, String?

This comment has been minimized.

Copy link
@ljharb

ljharb May 25, 2016

Author Member

I discussed this with @bterlson in stage 3, and this was the preferred mechanism.

The capitalization seems to have been made consistent since I initially wrote the text - will update!

This comment has been minimized.

Copy link
@ljharb

ljharb May 25, 2016

Author Member

oh actually, it's lowercased in a number of places - I think we should make them all consistent in a separate commit/PR.

spec.html Outdated
1. Let _intMaxLength_ be ? ToLength(_maxLength_).
1. Let _stringLength_ be the number of elements in S.
1. If _intMaxLength_ is not greater than _stringLength_, return _S_.
1. If _fillString_ is *undefined*, let _filler_ be a string consisting solely of the code unit U+0020 (SPACE).

This comment has been minimized.

Copy link
@annevk

annevk May 25, 2016

Member

See above.

spec.html Outdated
1. Let _O_ be ? RequireObjectCoercible(*this* value).
1. Let _S_ be ? ToString(_O_).
1. Let _intMaxLength_ be ? ToLength(_maxLength_).
1. Let _stringLength_ be the number of elements in S.

This comment has been minimized.

Copy link
@annevk

annevk May 25, 2016

Member

S -> S

@annevk

This comment has been minimized.

Copy link
Member

annevk commented May 25, 2016

To be clear, I don't think putting code unit and U+ together makes sense. They are a little different. The standard seems to typically use "character"...

@ljharb

This comment has been minimized.

Copy link
Member Author

ljharb commented May 25, 2016

@annevk hmm - it seems that all the previous examples have been converted to use "0x" notation - grep the spec for "string consisting". I'll happily convert this from "U+0020" to "0x0020" though.

@ljharb ljharb force-pushed the ljharb:string-padstart branch from 8148b68 to 27832af May 25, 2016

@annevk

This comment has been minimized.

Copy link
Member

annevk commented May 25, 2016

You still have "a string" and "a new String value".

@ljharb

This comment has been minimized.

Copy link
Member Author

ljharb commented May 25, 2016

Both capitalizations are identically equivalent and appear numerous times throughout the spec.

@annevk

This comment has been minimized.

Copy link
Member

annevk commented May 25, 2016

Wouldn't you want to use a single style inside one algorithm though? Anyway, up to you all...

@ljharb ljharb force-pushed the ljharb:string-padstart branch from 27832af to 8b72d16 May 25, 2016

@ljharb

This comment has been minimized.

Copy link
Member Author

ljharb commented May 25, 2016

Fair enough :-) updated.

spec.html Outdated
<emu-note>The first argument _maxLength_ will be clamped such that it can be no smaller than the length of the *this* value.</emu-note>
<emu-note>The optional second argument _fillString_ defaults to *" "* (a String consisting of 0x0020 SPACE).</emu-note>
</emu-clause>

<!-- es6num="21.1.4" -->
<emu-clause id="sec-properties-of-string-instances">

This comment has been minimized.

Copy link
@claudepache

claudepache May 25, 2016

Contributor

The logical placement of the new clauses seems wrong. In order to respect both section hierarchy and alphabetical order:

  • they should be placed between subsections String.prototype.normalize and String.prototype.repeat, inside (and not after) section "Properties of the String Prototype Object";
  • String.prototype.padEnd should be placed before String.prototype.padStart.

This comment has been minimized.

Copy link
@ljharb

ljharb May 25, 2016

Author Member

I intended to place them at the end of the section "Properties of the String Prototype Object" - I didn't realize they were supposed to be alphabetized. I'll fix both.

@ljharb ljharb force-pushed the ljharb:string-padstart branch from 8b72d16 to c31a686 May 25, 2016

@arrowrowe arrowrowe referenced this pull request May 25, 2016

Closed

Weekly for 2016/06/01 #74

3 of 5 tasks complete

@bterlson bterlson merged commit fba0bff into tc39:master Jun 1, 2016

@ljharb ljharb deleted the ljharb:string-padstart branch Jun 1, 2016

zloirock added a commit to kangax/compat-table that referenced this pull request Jun 1, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.