support module live bindings in arbitary positions not in Program statement position - fixes #1760

This commit is contained in:
Sebastian McKenzie
2015-06-16 00:41:53 +01:00
parent 050bcec617
commit fb485567b9
11 changed files with 229 additions and 91 deletions

View File

@@ -0,0 +1,5 @@
if (true) {
import foo from "foo";
} else {
import bar from "foo";
}

View File

@@ -0,0 +1,4 @@
{
"throws": "Duplicate module declarations with the same source but in different scopes",
"loose": "es6.modules"
}

View File

@@ -1 +1,7 @@
export var foo = 5;
if (true) {
import bar from "bar";
}
bar;

View File

@@ -2,4 +2,12 @@
exports.__esModule = true;
var foo = 5;
exports.foo = foo;
exports.foo = foo;
if (true) {
var _bar = require("bar");
var _bar2 = babelHelpers.interopRequireDefault(_bar);
}
bar;