Skip to content

Support es7 exponation operator #2102

Description

https://github.com/rwaldron/exponentiation-operator I don't think it needs proposal.
Few emitting examples :

x**y 
Math.pow(x,y)

x **= y 
x = Math.pow(x, y);

Activity

  1. RyanCavanaugh commented on Feb 23, 2015

    @RyanCavanaugh
    Member

    Creating an ES7 label 😄

    What happens if Math is shadowed in the current scope? Error?

  2. fdecampredon commented on Feb 23, 2015

    @fdecampredon
    Author

    What happens if Math is shadowed in the current scope? Error?

    I guess, a more sophisticated solution could be to capture pow in some way before Math gets shadowed but it's not really necessary in my opinion. Shadowing Math is not so common....

  3. basarat commented on Feb 23, 2015

    @basarat
    Contributor

    What happens if Math is shadowed in the current scope

    error 👍

  4. DanielRosenwasser commented on Feb 23, 2015

    @DanielRosenwasser
    Member

    I'm sure we could just perform some appropriate tests to see if Math.pow is working correctly. (Note: this is a joke)

    error 👍

    That's a rather untraditional direction to take. We don't currently take that approach with String in certain places where it might be more convenient or efficient to do so. On the other hand, I think the alternative would be __exponentiate, __exp, or __pow.

  5. fdecampredon commented on Feb 23, 2015

    @fdecampredon
    Author

    Daniel Rosenwasser (@DanielRosenwasser) you want to check if Math.pow return a fine result if Math has been shadowed ?

  6. DanielRosenwasser commented on Feb 23, 2015

    @DanielRosenwasser
    Member

    Sorry, you'll have to forgive me, that was a joke. I've amended my comment to clarify it.

  7. fdecampredon commented on Feb 23, 2015

    @fdecampredon
    Author

    No that's me sorry, since my english is far from being perfect I often fail to understand what is a joke in some context ^^.

  8. danquirk commented on Apr 21, 2015

    @danquirk
    Member

    We obviously want/will support this when the time comes but given how early it is in ES7's development process we'd rather close this and wait on locking down exactly what ES7 is doing. As we've always said, ending up misaligned with a future ES version is our worst case scenario. Although it may be quite likely this ends up in ES7 as currently spec'd the risk of that not being the case isn't enough to add this to TypeScript today given the relatively low value of this operator.

  9. added
    DeclinedThe issue was declined as something which matches the TypeScript vision
    and removed on Apr 21, 2015
  10. RyanCavanaugh commented on Apr 21, 2015

    @RyanCavanaugh
    Member

    Once ES7 decides the exact syntax here (I could see ^^ or ** happening) and whether or not it's exactly equivalent to Math.pow, we can revisit this to see about downlevel emit.

  11. locked and limited conversation to collaborators on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeclinedThe issue was declined as something which matches the TypeScript visionES7Relates to the ES7 SpecSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions