clean up runtime generation declarations

This commit is contained in:
Sebastian McKenzie
2014-11-09 18:22:26 +11:00
parent 463165e0c8
commit b217453d49

View File

@@ -5,10 +5,11 @@ var t = require("./types");
var _ = require("lodash");
module.exports = function (namespace) {
var body = [];
var container = t.functionExpression(null, [], t.blockStatement(body));
namespace = t.identifier(namespace || "to5Runtime");
var tree = t.program([t.expressionStatement(t.callExpression(container, []))]);
var body = [];
var container = t.functionExpression(null, [], t.blockStatement(body));
var tree = t.program([t.expressionStatement(t.callExpression(container, []))]);
body.push(t.variableDeclaration("var", [
t.variableDeclarator(t.identifier("self"), t.conditionalExpression(
@@ -21,8 +22,6 @@ module.exports = function (namespace) {
)
]));
var namespace = t.identifier(namespace || "to5Runtime");
body.push(t.variableDeclaration("var", [
t.variableDeclarator(
namespace,