Skip to content

[Bug]: super operator call using ternary operator #16121

@simakvladimir

Description

@simakvladimir

💻

  • Would you like to work on a fix?

How are you using Babel?

@babel/cli

Input code

7.20.15 - Babel REPL

latest + force all transform - Babel REPL

Configuration file name

No response

Configuration

see conf in REPL example

Current and expected behavior

Current behavior:
v7.20.5/7.21.9: throw exception in runtime - Super constructor may only be called once
latest + force all transform : no exception but generates super call same way

It works fine, when use "if else" instead ternary - example

Expected behavior:
no errors in runtime; no redundant super calls

Environment

  • babel version: 7.20.15 or 7.21.9

Possible solution

No response

Additional context

No response

Metadata

Metadata

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