Comments (8)
That's exactly what it's saying already; I agree that making the wording match the existing cases of this pattern would be better.
from proposal-string-left-right-trim.
Okay, I guess I will prepare a PR for this wording change.
from proposal-string-left-right-trim.
I’d like to have clarification about the name
of the aliased methods. According to the proposal’s README the String.prototype.trimLeft.name
should be 'trimStart'
, but the currently proposed spec text doesn’t make that happen.
+@sebmarkbage @evilpie @ljharb
from proposal-string-left-right-trim.
The intention is that the spec ensures this by only defining trimStart/trimEnd. The aliases defined in annex B has the same object instance and therefore has to have the same name. Although I agree that it is not very clear.
from proposal-string-left-right-trim.
I believe the current spec does not suffice normatively, because of https://tc39.github.io/ecma262/#sec-ecmascript-standard-built-in-objects:
Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. For functions that are specified as properties of objects, the name value is the property name string used to access the function.
from proposal-string-left-right-trim.
I think it does suffice; because the Start variants are defined first, with the Start names; and then later, in annex b, the Left variants are aliases to the pre-existing Start objects. This works for Array.prototype.values/Symbol.iterator, for example.
However, it might be a good idea to add explicit sentences in the Left variants indicating that their names are the Start variants.
from proposal-string-left-right-trim.
Can I suggest we reuse the language for Array#@@iterator
?
The initial value of the @@iterator property is the same function object as the initial value of the Array.prototype.values property.
This would be an editorial change only in the proposal, so it shouldn't affect any in the stage process or merging it to the specs.
from proposal-string-left-right-trim.
See #25
from proposal-string-left-right-trim.
Related Issues (8)
- Start is not Left! HOT 8
- Please transfer repository to tc39 HOT 1
- Have we considered a paramater to the trimX() functions similar to C# usage. HOT 2
- Advance to stage 4 HOT 2
- Add trimStart/trimEnd HOT 1
- [Q] `String#{trimStart, trimEnd}` and `String#{trimLeft, trimRigth}` equality HOT 7
- Todo List HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proposal-string-left-right-trim.