small performance improvements
This commit is contained in:
parent
4a1c393bdb
commit
7fccf98c10
@ -22,8 +22,7 @@ CommonJSInteropFormatter.prototype.importSpecifier = function (specifier, node,
|
||||
})])
|
||||
)
|
||||
]));
|
||||
return;
|
||||
} else {
|
||||
CommonJSFormatter.prototype.importSpecifier.apply(this, arguments);
|
||||
}
|
||||
|
||||
CommonJSFormatter.prototype.importSpecifier.apply(this, arguments);
|
||||
};
|
||||
|
||||
@ -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)
|
||||
]));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@ -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);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user