Skip to content

Partial application transform does not support super method call #17654

@JLHwung

Description

@JLHwung

💻

  • Would you like to work on a fix?

How are you using Babel?

Programmatic API (babel.transform, babel.parse)

Input code

class C extends class {
  static x = "base"
  static concat(y, z) { return [this.x, y, z].join(" "); }
} {
  static x = "derived"
  static concat(y, z) { return [this.x, y, z].join("_"); }
  static {
    console.log(super.concat(?, "invoked")("is"))
  }
}

REPL

Configuration file name

No response

Configuration

{
  "filename": "repl.js",
  "plugins": [
    [
      "@babel/plugin-proposal-partial-application@7.27.1",
      {}
    ]
  ],
  "sourceType": "module"
}

Current and expected behavior

Current: The transpiled output throws syntax error "invalid use of keyword 'super'"

Expected: The input is valid and it should log "derived is invoked" to the console.

Environment

REPL

Possible solution

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions