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

Allow imported module members to be named default #4388

Merged
merged 1 commit into from
Dec 5, 2016

Conversation

GeoffreyBooth
Copy link
Collaborator

Closes #4387.

Apparently code like this is not only allowed in ES2015, it’s common:

import { default } from 'lib';

Although import default from 'lib'; is not allowed in ES.

This PR allows destructured import (and export-import) of module members named default.

@lydell lydell merged commit 3ea0481 into jashkenas:master Dec 5, 2016
@lydell lydell deleted the import-member-named-default branch December 5, 2016 06:15
@lydell
Copy link
Collaborator

lydell commented Dec 5, 2016

I never stop learning new stuff about import/export. Good work!

@GeoffreyBooth
Copy link
Collaborator Author

Too bad we didn’t slip this in before 1.12.0. Well, I guess it won’t be long before 1.12.1 . . .

@lydell
Copy link
Collaborator

lydell commented Dec 5, 2016

We could do 1.12.1 as soon as possible, if you feel like it.

@GeoffreyBooth
Copy link
Collaborator Author

GeoffreyBooth commented Dec 5, 2016

Let’s see what else people find in the next few days?

There was a workaround for #4387, it occurs to me now. One could always have done:

import * as lib from 'lib'
def = lib.default

So there shouldn’t be too much urgency in getting this fix released.

GeoffreyBooth added a commit to GeoffreyBooth/coffeescript that referenced this pull request Dec 7, 2016
@GeoffreyBooth GeoffreyBooth mentioned this pull request Dec 7, 2016
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.

2 participants