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
The parens around (a?.b).c have a semantic meaning that prevents the short-circuiting behavior of later chaining. Eg, (null?.b).c will throw a TypeError, because the .c access is not optional.
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
The minifier is removing the parens in
(a?.b).c
.The parens around
(a?.b).c
have a semantic meaning that prevents the short-circuiting behavior of later chaining. Eg,(null?.b).c
will throw aTypeError
, because the.c
access is not optional.Input code
Config
Playground link
https://play.swc.rs/?version=1.3.7&code=H4sIAAAAAAAAA9NItNdL0tRLBgDvvqKQCAAAAA%3D%3D&config=H4sIAAAAAAAAA22TQXLDIAxF7%2BJ1F50ue4DuegaGgHBIAXmQSOPJ5O4Vjg1x0p31%2FCXEl7gOJzLD53WYdCbI9YvmxPoyfA48T0Am%2B4mHt4FJkNOB4CaBziOwSIA%2B3j%2Fe5XdAJFgFb0P0ybu5FjMYpwxE9VuSSoTE1HQ6Z%2FyVkHOR6IAYQKeXWGlSPjGMkHuqwRD0RKDOOreMeprOnjDtUGGwaso4PdBkPXtMUmxjFrRVBi004DMY9mfoEqkhkkTSWOtkgRYOZRyrgXclnHUomlstuCw2yIkt74ieWLmS6AntOr2j%2ByVXlXcqA5ecNs0Jfdr58AMgfQZNlHSEnrlwJ3PYK90%2FKp%2BcDJHnRmXCvasEo1xOee%2FaDWvXkNl3tzLYYqDe0PTiK9xdiLwFBc6J2y2Zfj2bYy9WlxFdC8U17foM7qHa9mlP6wq8wC%2Fpih%2FHsfKo%2BfjMaI4HDC8lIvAR7QsWIxifYZbtvUzPtCQLYjPYhx%2BFatjWVIbPqEJ9bZvPshCSo8aAh7a%2B8iijTmNby1sFaEsF18U8ea1iRMR0ouHWn%2Bi2U%2FS9qpdqfzFN4fsXBAAA
Expected behavior
Actual behavior
Version
1.3.7
Additional context
Re: #5332
The text was updated successfully, but these errors were encountered: