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