Skip to content
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

fix default exported classes without a name #4518

Merged
merged 2 commits into from Sep 18, 2016

Conversation

danez
Copy link
Member

@danez danez commented Sep 14, 2016

Q A
Bug fix? yes
Breaking change? no
New feature? no
Deprecations? no
Spec compliancy? no
Tests added/pass? yes
Fixed tickets
License MIT
Doc PR

Currently this

export default class {};

will be transformed to

exports.default = class{}

although the es3-literal transform is active.
Basically a followup of #3368 that @loganfsmyth did.

The fix does the same as for variables and requeues them.

Also added tests for all combinations of export default.

This correctly requeues class without name so the es3 transform can
transform the default keyword.
@codecov-io
Copy link

codecov-io commented Sep 14, 2016

Current coverage is 88.32% (diff: 100%)

No coverage report found for master at de975b9.

Powered by Codecov. Last update de975b9...695347a


// Manualy re-queue `export default class {}` expressions so that the ES3 transform
// has an opportunity to convert them. Ideally this would happen automatically from the
// replaceWith above. See T7166 for more info.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we link to the github issue now?

@hzoo hzoo added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Sep 14, 2016
@hzoo
Copy link
Member

hzoo commented Sep 14, 2016

👍

@hzoo hzoo merged commit cbbc1c7 into master Sep 18, 2016
@hzoo hzoo deleted the fix-commonjs-export-default-class branch September 18, 2016 02:50
panagosg7 pushed a commit to panagosg7/babel that referenced this pull request Jan 17, 2017
* fix default exported classes without a name

This correctly requeues class without name so the es3 transform can
transform the default keyword.

* Replace phabricator issue number with github
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 7, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants