Skip to content

[Bug]: optional chain logic lost when using with super property get #16767

@shawandshaw

Description

@shawandshaw

💻

  • Would you like to work on a fix?

How are you using Babel?

babel-loader (webpack)

Input code

https://babeljs.io/repl#?browsers=last%202%20versions&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=MYGwhgzhAEDKvQN4ChrQJDAPYDsIBcAnAV2Hy0IAocwBbAUwEoV1p8ALASwgDoaHoAXmgByKCIDU_egG5UaBcnQBfZKuShIMAILbo9AB756OACYx4SeZlwESZCtTpMUChRGIAHelWmM5bmgc3HzOQqJgYCLQUs5yKshKkQDihPT0-JQQzEroHt6EPADmaRkA_DxZMaLstSL-Sqrq2Hj40GDhOPQA7tC6lCIAVmDAANb1cshgPCmlmSKm9UA&debug=false&forceAllTransforms=false&modules=commonjs&shippedProposals=false&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=env&prettier=false&targets=&version=7.25.4&externalPlugins=%40babel%2Fplugin-transform-modules-commonjs%407.21.2&assumptions=%7B%7D

Configuration file name

No response

Configuration

No response

Current and expected behavior

Current:
got tranformed code losing optional chain check logic, which causes an undefined.apply error

expected:
tranformed code should remain the optional chain check logic

Environment

  • Babel version(s): 7.25.2
  • Node: 16
  • pnpm version: 8.8.0
  • OS: macos Sonoma
  • Mac with apple chip

Possible solution

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    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