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

Importing as the same local name should throw an error on transpile. #95

Closed
rwjblue opened this issue Feb 2, 2015 · 3 comments
Closed

Comments

@rwjblue
Copy link
Contributor

rwjblue commented Feb 2, 2015

Example 1:

Input:

import { stuff } from 'foo';
import { stuff } from 'bar';

stuff();

Output:

define(['foo', 'bar'], function (foo, bar) {

    'use strict';

    bar.stuff();

});

Example 2

Input:

import stuff from 'foo';
import stuff from 'bar';

stuff();

Output:

define(['foo', 'bar'], function (stuff, stuff) {

    'use strict';

    stuff['default']();

});

I think we should throw an error at transpile time for both scenarios above.

@rwjblue
Copy link
Contributor Author

rwjblue commented Feb 2, 2015

This was discovered after updating Ember, and realizing I accidentally had imported with the same name twice (fixed in emberjs/ember.js#10338).

@Rich-Harris
Copy link
Contributor

I think we should throw an error at transpile time for both scenarios above.

Agree. Thanks - fixed

@Rich-Harris
Copy link
Contributor

Released in 0.6.16

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

No branches or pull requests

2 participants