FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Bug]: Super call in arrow function causing infinite recursion · Issue #15148 · babel/babel · GitHub

/ babel Public

[Bug]: Super call in arrow function causing infinite recursion #15148

Description

💻

  • Would you like to work on a fix?

How are you using Babel?

@babel/cli

Input code

class Bar extends Foo {
    constructor() {
        let f = (...args) => super(...args);
        f();
    }
}

Example on Babel REPL

Configuration file name

.babelrc

Configuration

{
    "presets": [["@babel/preset-env", { "bugfixes": true }]],
    "targets": ["since 2017"]
}

Current and expected behavior

Current behavior (silently success and causing infinite recursion)
"use strict";

class Bar extends Foo {
  constructor() {
    var _supercall = function _supercall() {
      return _supercall(...arguments);
    };
    let f = function f() {
      return _supercall(...arguments);
    };
    f();
  }
}
Expected behavior
  • Give warning or error in this situation;
  • Or just keep the arrow function;
  • Or transpile the whole class into pre-ES6 style (just like the result of using since 2016).

Environment

  • Babel version: v7.20.2
  • Node: v16.17.0
  • pnpm version: pnpm 7.14.2
  • OS: Windows 10
  • Monorepo: no

Possible solution

No response

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

outdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL