fix tests as per acorn upgrade

This commit is contained in:
Sebastian McKenzie
2014-12-27 21:29:24 +11:00
parent 7fcd8ea642
commit f4e516e8ce
4 changed files with 9 additions and 9 deletions

View File

@@ -33,22 +33,22 @@ SystemFormatter.prototype._exportsWildcard = function (objectIdentifier) {
var right = objectIdentifier;
var block = t.blockStatement([
this._makeExportStatements([leftIdentifier, valIdentifier])
this.buildExportCall(leftIdentifier, valIdentifier)
]);
return t.forInStatement(left, right, block);
};
SystemFormatter.prototype._exportsAssign = function (id, init, isExpression) {
return this.buildExportCall(id.name, init, true);
return this.buildExportCall(t.literal(id.name), init, true);
};
SystemFormatter.prototype.remapExportAssignment = function (node) {
return this.buildExportCall(node.left.name, node);
return this.buildExportCall(t.literal(node.left.name), node);
};
SystemFormatter.prototype.buildExportCall = function (id, init, isStatement) {
var call = t.callExpression(this.exportIdentifier, [t.literal(id), init]);
var call = t.callExpression(this.exportIdentifier, [id, init]);
if (isStatement) {
return t.expressionStatement(call);
} else {

View File

@@ -1 +1 @@
export default function a() {};
export default function a() {}

View File

@@ -4,8 +4,8 @@ export default [];
export default foo;
export default function () {};
export default class {};
export default function foo() {};
export default class Foo {};
export default function foo() {}
export default class Foo {}
export * from "foo";
export { foo } from "foo";
export { foo, bar } from "foo";

View File

@@ -4,8 +4,8 @@ export default [];
export default foo;
export default function () {};
export default class {};
export default function foo() {};
export default class Foo {};
export default function foo() {}
export default class Foo {}
export * from "foo";
export { foo } from "foo";
export { foo, bar } from "foo";