export as module.exports if there are no other ExportDeclarations in commonInterop module formatter @guybedford

This commit is contained in:
Sebastian McKenzie
2014-11-24 10:04:24 +11:00
parent f4ce3a23ad
commit e3b8fa93e2
7 changed files with 125 additions and 29 deletions

View File

@@ -1,13 +1,13 @@
"use strict";
exports["default"] = 42;
exports["default"] = {};
exports["default"] = [];
exports["default"] = foo;
exports["default"] = function () {};
exports["default"] = function () {};
module.exports = foo;
module.exports = 42;
module.exports = {};
module.exports = [];
module.exports = foo;
module.exports = function () {};
module.exports = function () {};
function foo() {}
exports["default"] = foo;
var Foo = function Foo() {};
exports["default"] = Foo;
module.exports = Foo;

View File

@@ -1,6 +1,5 @@
"use strict";
var _arguments = arguments;
var _argumentsToArray = function (args) {
var target = new Array(args.length);
for (var i = 0; i < args.length; i++) {
@@ -11,5 +10,5 @@ var _argumentsToArray = function (args) {
};
var concat = function () {
var arrs = _argumentsToArray(_arguments);
var arrs = _argumentsToArray(arguments);
};