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
ThomasJClark
changed the title
Object properties are incorrectly erased when using hoist_props
Object properties are incorrectly erased when using hoist_propsJul 26, 2023
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 some, but not all, properties of an object are accessed, other properties are erased, even if the object itself is exported.
Input code
Config
Playground link
https://play.swc.rs/?version=1.3.71&code=H4sIAAAAAAAAA0vOzysuUchPylKwVajmUgCCtPx8KwVDHTA7KbHISsFIh6vWmosrGagyPydVLyc%2FXQOoXg8opwkUTq0oyC8qUUhJTUsszQGbZA0ASUDqO1QAAAA%3D&config=H4sIAAAAAAAAA02MSwqAMAxE956iZO0JvE0JKVT6I6lgKb270Yq4CMy8mUxfjIFdEDbTVaoploX480qkpWpPJUAYrSD7UuEJxzp%2FQs5CWnA2CL0s%2BuRd%2B%2B9gjoVJRFnlg%2BbCct%2B4AIS%2FUhWHAAAA
Expected behavior
The export is equal to
{ foo: 1, bar: 2 }
Actual behavior
The export is equal to
{ bar: 2 }
, andfoo
is erased from the compiled code.Version
1.3.70, 1.3.71
Additional context
This only occurs when at least one property of
obj
is accessed. Without theconsole.log
, all properties ofobj
are correctly included.The text was updated successfully, but these errors were encountered: