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
Thanks for reporting! It looks like the someFieldIWantToExport declaration is being misidentified by the parser as ObjectShorthandBlockScopedDeclaration when it should be ObjectShorthandTopLevelDeclaration, so it ends up being elided like a type.
Fixes#563Fixes#473
The type-only export elision implemented in #433 had a false positive for
destructure delcarations, since `getDeclarationInfo` only looks at top-level
declarations and top-level expressions like `const {x} = ...` weren't being
marked correctly. To fix, we can mark object shorthand declarations as top-level
when applicable. I also refactored both relevant code paths to avoid the
repeated assignment left-hand side.
Fixes#563Fixes#473
The type-only export elision implemented in #433 had a false positive for
destructure delcarations, since `getDeclarationInfo` only looks at top-level
declarations and top-level expressions like `const {x} = ...` weren't being
marked correctly. To fix, we can mark object shorthand declarations as top-level
when applicable. I also refactored both relevant code paths to avoid the
repeated assignment left-hand side.
It looks like named exports that come from destructuring an object don't get compiled:
Example
https://sucrase.io/#compressedCode=H4sIAHh6w18AA8vMLcgvKlEISk1MLtFRqFZwzgcK5KXmlSjUKqQV5ecqKBWBpJSsubiS8%2FOKS4BKSotTg0sSS1KBKmwhGq0V9PUVQjIyixVS8lOL89RLFMrzi7K5uGCiIF4xiAcxAm4AVLseTABoSWoF2D3ItsDEUlLTEktzShQcCwqACgGDCiqfuQAAAA%3D%3D
The text was updated successfully, but these errors were encountered: