remove interopRequire from system module formatter
This commit is contained in:
parent
cd1eb11171
commit
b63bd8cba0
@ -5,6 +5,7 @@ Gaps between patch versions are faulty/broken releases.
|
||||
## 2.0.2
|
||||
|
||||
* Inherit comments in `for-of` transformer.
|
||||
* Remove `interopRequire` from `system` module formatter.
|
||||
|
||||
## 2.0.1
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ AMDFormatter.prototype.importSpecifier = function (specifier, node, nodes) {
|
||||
|
||||
if (t.isImportBatchSpecifier(specifier)) {
|
||||
// import * as bar from "foo";
|
||||
} else if (t.isSpecifierDefault(specifier)) {
|
||||
} else if (t.isSpecifierDefault(specifier) && !this.noInteropRequire) {
|
||||
// import foo from "foo";
|
||||
ref = t.callExpression(this.file.addDeclaration("interop-require"), [ref]);
|
||||
} else {
|
||||
|
||||
@ -8,6 +8,7 @@ var _ = require("lodash");
|
||||
|
||||
function SystemFormatter(file) {
|
||||
this.exportIdentifier = file.generateUidIdentifier("export");
|
||||
this.noInteropRequire = true;
|
||||
|
||||
AMDFormatter.apply(this, arguments);
|
||||
|
||||
|
||||
@ -7,9 +7,8 @@ System.register("es6-modules-system/imports-default/expected", ["foo"], function
|
||||
execute: function () {
|
||||
"use strict";
|
||||
|
||||
var foo = _foo.default;
|
||||
|
||||
var foo = _foo.default;
|
||||
var foo = _foo["default"];
|
||||
var foo = _foo["default"];
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
@ -7,9 +7,8 @@ System.register("es6-modules-system/imports-mixing/expected", ["foo"], function
|
||||
execute: function () {
|
||||
"use strict";
|
||||
|
||||
var foo = _foo.default;
|
||||
|
||||
var foo = _foo["default"];
|
||||
var xyz = _foo.baz;
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
@ -11,7 +11,8 @@ System.register("es6-modules-system/overview/expected", ["foo", "foo-bar", "./di
|
||||
execute: function () {
|
||||
"use strict";
|
||||
|
||||
var foo = _foo.default;
|
||||
var foo = _foo["default"];
|
||||
var foo = _foo;
|
||||
var bar = _foo.bar;
|
||||
var bar = _foo.foo;
|
||||
_export("test", test);
|
||||
@ -21,4 +22,4 @@ System.register("es6-modules-system/overview/expected", ["foo", "foo-bar", "./di
|
||||
_export("default", test);
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user