GithubHelp home page GithubHelp logo

Comments (8)

ljharb avatar ljharb commented on September 26, 2024 2

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.

evilpie avatar evilpie commented on September 26, 2024 2

Okay, I guess I will prepare a PR for this wording change.

from proposal-string-left-right-trim.

mathiasbynens avatar mathiasbynens commented on September 26, 2024

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.

sebmarkbage avatar sebmarkbage commented on September 26, 2024

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.

mathiasbynens avatar mathiasbynens commented on September 26, 2024

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.

ljharb avatar ljharb commented on September 26, 2024

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.

leobalter avatar leobalter commented on September 26, 2024

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.

evilpie avatar evilpie commented on September 26, 2024

See #25

from proposal-string-left-right-trim.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.