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

Normative: Add String.prototype.{trimStart/trimEnd} (+ trimLeft/trimRight) #1275

Merged
merged 2 commits into from
Feb 20, 2019

Conversation

evilpie
Copy link
Contributor

@evilpie evilpie commented Jul 25, 2018

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 corresponding trimLeft and trimRight functions - without any standard specification.
For consistency with padStart/padEnd we propose trimStart and trimEnd and trimLeft/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.

@ljharb 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
spec.html Show resolved Hide resolved
@littledan
Copy link
Member

littledan commented Oct 18, 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?

@mathiasbynens
Copy link
Member

@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.

@targos targos mentioned this pull request Jan 30, 2019
14 tasks
@ljharb 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
@ljharb ljharb requested review from zenparsing and a team January 30, 2019 00:35
@ljharb ljharb added the es2019 label Feb 10, 2019
@bterlson bterlson merged commit 517f09a into tc39:master Feb 20, 2019
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants