Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Can you please turn off the exponentiation transform? #8731

Copy link
Copy link
Open
@steveluscher

Description

@steveluscher
Issue body actions

🐛 bug report

Preflight Checklist

  • I have read the [Contributing Guidelines][contributing] for this project.
  • I agree to follow the [Code of Conduct][code_of_conduct] that this project
    adheres to.
  • I have searched the issue tracker for an issue that matches the one I want
    to file, without success.

Description of the problem

How has this issue affected you? What are you trying to accomplish?

The exponentiation transform in Babel makes it impossible to run code of the form 2n ** 10n. This gets transformed to Math.pow(2n, 10n), which is a runtime error.

I think this transform should now be turned off. It penalizes code that uses BigInt, while actually being of little use given the penetration of the exponentiation operator in modern browsers.

To Reproduce

Link to sandbox: link

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.