Skip to content

Fix emit for object rest on a module export #32699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 5, 2019
Merged

Fix emit for object rest on a module export #32699

merged 3 commits into from
Aug 5, 2019

Conversation

rbuckton
Copy link
Contributor

@rbuckton rbuckton commented Aug 4, 2019

Fixes the emit for object rest binding patterns on exported variables.

Also fixes a few other small tooling bugs:

  • Fixes a bug in vary-by test configurations to allow running conformance/compiler tests against multiple module/target configurations.
  • gulp diff and gulp diff-rwc no longer block until your diff tool is closed.
  • You can add // @noTypesAndSymbols: true to the top of a test to skip .types and .symbols baselines if they're not relevant to the test.

Fixes #32656

@weswigham
Copy link
Member

Do we have a test for the empty binding pattern - export const {} = {};? The emit for that seems strange in the playground.

@rbuckton
Copy link
Contributor Author

rbuckton commented Aug 5, 2019

Hmm. You are correct, those seem a bit odd.

@rbuckton
Copy link
Contributor Author

rbuckton commented Aug 5, 2019

We do this intentionally, even if its a bit strange and could be cleaned up. The idea is that we need to preserve any possible side effects of the initializer, and we're transforming a variable declaration to a variable declaration, so we need to emit something. Arguably, this could be cleaned up, but I don't believe that's related to the issue this intends to resolve.

@rbuckton
Copy link
Contributor Author

rbuckton commented Aug 5, 2019

I will add the tests, so that we can refer to them later and can validate regressions, but I don't intend to address the current emit for those in this PR.

@rbuckton rbuckton merged commit e3f4979 into master Aug 5, 2019
@rbuckton rbuckton deleted the fix32656 branch August 5, 2019 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exported variable declaration with destructured object literal and CommonJS module target
2 participants