better wildcard imports and exports - fixes #224
This commit is contained in:
@@ -34,7 +34,8 @@ File.helpers = [
|
||||
"define-property",
|
||||
"async-to-generator",
|
||||
"interop-require-wildcard",
|
||||
"typeof"
|
||||
"typeof",
|
||||
"exports-wildcard"
|
||||
];
|
||||
|
||||
File.excludeHelpersFromRuntime = [
|
||||
|
||||
@@ -162,9 +162,9 @@ DefaultFormatter.prototype._exportSpecifier = function (getRef, specifier, node,
|
||||
};
|
||||
|
||||
DefaultFormatter.prototype._exportsWildcard = function (objectIdentifier) {
|
||||
return util.template("exports-wildcard", {
|
||||
OBJECT: objectIdentifier
|
||||
}, true);
|
||||
return t.expressionStatement(t.callExpression(this.file.addHelper("exports-wildcard"), [
|
||||
t.callExpression(this.file.addHelper("interop-require-wildcard"), [objectIdentifier])
|
||||
]));
|
||||
};
|
||||
|
||||
DefaultFormatter.prototype._exportsAssign = function (id, init) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
(function (obj) {
|
||||
for (var i in obj) {
|
||||
exports[i] = obj[i];
|
||||
if (exports[i] !== undefined) {
|
||||
exports[i] = obj[i];
|
||||
}
|
||||
}
|
||||
})(OBJECT);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user