-
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
Normative: Add String.prototype.{trimStart/trimEnd} (+ trimLeft/trimRight) #1275
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 tasks
ljharb
added
normative change
Affects behavior required to correctly evaluate some ECMAScript source text
web reality
pending stage 4
This proposal has not yet achieved stage 4, but may otherwise be ready to merge.
proposal
This is related to a specific proposal, and will be closed/merged when the proposal reaches stage 4.
labels
Jul 25, 2018
ljharb
approved these changes
Jul 25, 2018
sebmarkbage
approved these changes
Jul 25, 2018
claudepache
reviewed
Aug 14, 2018
Looks like this proposal is ready for Stage 4 (modulo editor reviews and @claudepache 's comment). Does anyone want to take on presenting it in the November 2018 TC39 meeting? |
@evilpie @sebmarkbage Feel free to reach out to me in case you cannot make it to the meeting. Happy to present it on your behalf. |
bterlson
approved these changes
Oct 24, 2018
bterlson
approved these changes
Jan 26, 2019
ljharb
added
has stage 4
This PR represents a proposal that has achieved stage 4, and is ready to merge.
and removed
pending stage 4
This proposal has not yet achieved stage 4, but may otherwise be ready to merge.
labels
Jan 30, 2019
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
has stage 4
This PR represents a proposal that has achieved stage 4, and is ready to merge.
has test262 tests
normative change
Affects behavior required to correctly evaluate some ECMAScript source text
proposal
This is related to a specific proposal, and will be closed/merged when the proposal reaches stage 4.
web reality
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a pull request for the stage 3 proposal https://github.com/tc39/proposal-string-left-right-trim. The proposal is/was championed by @sebmarkbage.
test262 tests: yes, tc39/test262@5931e31 and others
Rationale
ES5 standardized
String.prototype.trim
. All major engines have also implemented correspondingtrimLeft
andtrimRight
functions - without any standard specification.For consistency with
padStart
/padEnd
we proposetrimStart
andtrimEnd
andtrimLeft
/trimRight
as aliases required for web compatibility.Review notes
I wasn't quite sure where to put TrimString, but this follows String.prototype.replace with GetSubstitution by putting it inline.