You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
When target is
es2017
(< es2022), the optional chained private field in methodsearch
becomesundefined()
causing this runtime error:Input code
Config
Playground link
https://play.swc.rs/?version=1.3.74&code=H4sIAAAAAAAAA0vOSSwuVnDLz1eo5lJQUC4oyiwD0sWpiUXJGRqaYEEFhZKMzGI9sJy9noYmUKiWq5aLKzk%2Frzg%2FJ1UvJz9dIy%2B1HGSIhqYeTKumAgCEDmZWWwAAAA%3D%3D&config=H4sIAAAAAAAAA1VPSQ7CMAy85xWRzxyAA0j8gUdEwa2Csil2JaKqfydpk0Jv9iye8SykhDdpeMi5jGWJKhGmfS8IZc%2FqUxDgHJF0MpHh1FmmSg3KEq7QsjHAKo3I1YV0PV%2FuzQE2BMLuaJgz3gz5P1MHFxMSHYVVqvxo8ZgoWiq48JpWsv1S%2B24NbvAT9bD9MBh6dienCcXyBZ3DefIXAQAA
SWC Info output
No response
Expected behavior
I would expect that the function is not invoked:
Related, tsc generates:
Actual behavior
The search method is transpiled as:
notice the
_class_private_field_get1.call)(this)
.Version
1.3.74
Additional context
Issue related to private optional chaining: #3610 (but that issue does not call the property's value)
The text was updated successfully, but these errors were encountered: