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

Imports conflict with local variables #119

Closed
rlivsey opened this issue Mar 4, 2015 · 1 comment
Closed

Imports conflict with local variables #119

rlivsey opened this issue Mar 4, 2015 · 1 comment
Labels

Comments

@rlivsey
Copy link

rlivsey commented Mar 4, 2015

I thought this might be the same / related to #95 or #116, but still happens in 0.6.17.

I have the following in my app:

import {
  updateMeeting
} from 'minutebase/use-cases/meeting';

export function setupAgenda(meeting) {
  return updateMeeting(meeting);
};

Which is being transpiled to:

define('minutebase/use-cases/agenda', ['exports', 'ember', 'minutebase/use-cases/meeting'], function (exports, Ember, meeting) {
  'use strict';

  exports.setupAgenda = setupAgenda;

  function setupAgenda(meeting) {
    return meeting.updateMeeting(meeting);
  }
});

Notice that there's an imported meeting and a local meeting which tramples on it so meeting.updateMeeting is undefined.

Should the imported name be mangled/prefixed in some way to lessen the chance of a collision?

Rich-Harris added a commit that referenced this issue Mar 29, 2015
Rich-Harris added a commit that referenced this issue Mar 29, 2015
Prevent function arguments shadowing imports
@Rich-Harris
Copy link
Contributor

@rlivsey Thanks for the test case, this is fixed in 0.6.23. Sorry for the delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants