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

Properly handle function name inference in named exports #308

Merged
merged 1 commit into from Aug 27, 2018

Conversation

alangpierce
Copy link
Owner

Fixes #307

Instead of writing exports.f = () => {};, we write
const f = () => {}; exports.f = f; and still use exports.f for all writes
and reads. This is a little odd in that the variable is never used, but it makes
sure the export works fine. In the future, we possibly could refine it to only
do a special case when the RHS is an unnamed function, but that's a bit harder
to detect.

Fixes #307

Instead of writing `exports.f = () => {};`, we write
`const f = () => {}; exports.f = f;` and still use `exports.f` for all writes
and reads. This is a little odd in that the variable is never used, but it makes
sure the export works fine. In the future, we possibly could refine it to only
do a special case when the RHS is an unnamed function, but that's a bit harder
to detect.
@alangpierce alangpierce merged commit 6fb0e6d into master Aug 27, 2018
@alangpierce alangpierce deleted the fix-inferred-function-names branch October 1, 2018 00:43
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.

None yet

1 participant