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
Just ran into an odd bug, apparently exporting a const from an object spread doesn't work. I'm not quite sure why, but I noticed in the compiled source there's a duplicate const declaration (which I thought would be a syntax error).
Basic bug:
const{ a }={a: {}}export{a}// a will be undefined when imported anywhere
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.
Just ran into an odd bug, apparently exporting a const from an object spread doesn't work. I'm not quite sure why, but I noticed in the compiled source there's a duplicate const declaration (which I thought would be a syntax error).
Basic bug:
Reproduction: https://github.com/cwohlman/sucrase-stomp-export-reproduction
The text was updated successfully, but these errors were encountered: