remove useless root variable in umd module formatter

This commit is contained in:
Sebastian McKenzie 2014-10-19 17:48:59 +11:00
parent e76462303e
commit 44966849f9
13 changed files with 24 additions and 24 deletions

View File

@ -43,6 +43,6 @@ UMDFormatter.prototype.transform = function (ast) {
//
var call = b.callExpression(runner, [b.thisExpression(), factory]);
var call = b.callExpression(runner, [factory]);
program.body = [b.expressionStatement(call)];
};

View File

@ -1,4 +1,4 @@
(function (root, factory) {
(function (factory) {
if (typeof define === "function" && define.amd) {
define(AMD_ARGUMENTS, factory);
} else if (typeof exports !== "undefined") {

View File

@ -1,12 +1,12 @@
"use strict";
(function (root, factory) {
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
}
})(this, function (exports) {
})(function (exports) {
exports.default = 42;
exports.default = {};
exports.default = [];

View File

@ -1,12 +1,12 @@
"use strict";
(function (root, factory) {
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require("foo"));
}
})(this, function (exports, _foo) {
})(function (exports, _foo) {
(function(obj) {
for (var i in obj) {
exports[i] = obj[i];

View File

@ -1,12 +1,12 @@
"use strict";
(function (root, factory) {
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
}
})(this, function (exports) {
})(function (exports) {
exports.foo = foo;
exports.foo = foo;
exports.bar = bar;

View File

@ -1,12 +1,12 @@
"use strict";
(function (root, factory) {
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
}
})(this, function (exports) {
})(function (exports) {
exports.foo7 = foo7;
var foo = 1;
exports.foo = foo;

View File

@ -1,12 +1,12 @@
"use strict";
(function (root, factory) {
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "./evens"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require("./evens"));
}
})(this, function (exports, _evens) {
})(function (exports, _evens) {
exports.nextOdd = nextOdd;
var isEven = _evens.isEven;

View File

@ -1,12 +1,12 @@
"use strict";
(function (root, factory) {
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require("foo"));
}
})(this, function (exports, _foo) {
})(function (exports, _foo) {
var foo = _foo.default;
var foo = _foo.default;
});

View File

@ -1,11 +1,11 @@
"use strict";
(function (root, factory) {
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require("foo"));
}
})(this, function (exports, _foo) {
})(function (exports, _foo) {
var foo = _foo;
});

View File

@ -1,12 +1,12 @@
"use strict";
(function (root, factory) {
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require("foo"));
}
})(this, function (exports, _foo) {
})(function (exports, _foo) {
var foo = _foo.default;
var xyz = _foo.baz;
});

View File

@ -1,12 +1,12 @@
"use strict";
(function (root, factory) {
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require("foo"));
}
})(this, function (exports, _foo) {
})(function (exports, _foo) {
var bar = _foo.bar;
var bar = _foo.bar;
var baz = _foo.baz;

View File

@ -1,11 +1,11 @@
"use strict";
(function (root, factory) {
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo", "foo-bar", "./directory/foo-bar"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require("foo"), require("foo-bar"), require("./directory/foo-bar"));
}
})(this, function (exports, _foo, _fooBar, _directoryFooBar) {
})(function (exports, _foo, _fooBar, _directoryFooBar) {
});

View File

@ -1,12 +1,12 @@
"use strict";
(function (root, factory) {
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo", "foo-bar", "./directory/foo-bar"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require("foo"), require("foo-bar"), require("./directory/foo-bar"));
}
})(this, function (exports, _foo, _fooBar, _directoryFooBar) {
})(function (exports, _foo, _fooBar, _directoryFooBar) {
var foo = _foo.default;
var foo = _foo;
var bar = _foo.bar;