Skip to content
This repository has been archived by the owner on Mar 29, 2018. It is now read-only.

Module bindings are not propagated across multiple modules when using import * as syntax #189

Open
Pauan opened this issue Jan 2, 2015 · 0 comments
Assignees
Labels

Comments

@Pauan
Copy link

Pauan commented Jan 2, 2015

Consider these three modules:

// foo.js
export var foo = 5;

// bar.js
import { foo } from "./foo";
export { foo };

// qux.js
import * as bar from "./bar";
console.log(bar.foo);

Using the "bundle" format of es6-module-transpiler version 0.9.6, I get this output:

(function() {
    "use strict";

    var $$bar$$ = {
        get foo() {
            return $$bar$$foo;
        }
    };

    var $$foo$$foo = 5;
    console.log($$bar$$.foo);
}).call(this);

//# sourceMappingURL=build.js.map

As you can see, it incorrectly uses the variable $$bar$$foo, rather than the correct variable $$foo$$foo.

If I change qux.js to this, then it works correctly:

import { foo } from "./bar";
console.log(foo);
@caridy caridy self-assigned this Jan 13, 2015
@caridy caridy added the bug label Jan 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants