-
Notifications
You must be signed in to change notification settings - Fork 21
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
Named exports that are functions can be elevated incorrectly. #73
Comments
For a less contrived example, see the following code in Ember:
The resulting named export of |
Another example: var foo = function foo() { }
export {
foo
} define(['exports'], function (exports) {
'use strict';
exports.foo = foo;
var foo = function foo() { }
}); It is obvious that |
When looking for top-level function names we need to only look at nodes that create bindings in the local scope, which are function declarations. Closes #73.
I have this fixed locally - am on a plane with crappy WiFi, will push later On Sun, 25 Jan 2015 13:06 Robert Jackson notifications@github.com wrote:
|
When looking for top-level function names we need to only look at nodes that create bindings in the local scope, which are function declarations. Closes #73.
When looking for top-level function names we need to only look at nodes that create bindings in the local scope, which are function declarations. Closes #73.
The following input:
Results in:
It seems that since a function named
foo
existed (even though it was not available asfoo
since it was assigned tosomeFunction
variable) the transpiler assumed that it could hoist the named export to the beginning of the file. In this case, it results inexports.foo
beingundefined
when later required by other modules.The text was updated successfully, but these errors were encountered: