small performance improvements

This commit is contained in:
Sebastian McKenzie 2014-11-20 15:09:20 +11:00
parent 4a1c393bdb
commit 7fccf98c10
3 changed files with 6 additions and 8 deletions

View File

@ -22,8 +22,7 @@ CommonJSInteropFormatter.prototype.importSpecifier = function (specifier, node,
})])
)
]));
return;
} else {
CommonJSFormatter.prototype.importSpecifier.apply(this, arguments);
}
CommonJSFormatter.prototype.importSpecifier.apply(this, arguments);
};

View File

@ -4,9 +4,10 @@ var _ = require("lodash");
module.exports = function (ast, file) {
var body = ast.program.body;
_.each(file.declarations, function (declar) {
for (var i in file.declarations) {
var declar = file.declarations[i];
body.unshift(t.variableDeclaration("var", [
t.variableDeclarator(declar.uid, declar.node)
]));
});
}
};

View File

@ -22,9 +22,7 @@ exports.TaggedTemplateExpression = function (node, parent, file) {
t.arrayExpression(raw)
]));
_.each(quasi.expressions, function (expr) {
args.push(expr);
});
args = args.concat(quasi.expressions);
return t.callExpression(node.tag, args);
};