remove unused variables in react transformer

This commit is contained in:
Sebastian McKenzie
2014-11-11 19:14:00 +11:00
parent 6dfe66bce3
commit 0ba9216d6f

View File

@@ -38,7 +38,7 @@ exports.XJSAttribute = {
};
exports.XJSOpeningElement = {
exit: function (node, parent, file) {
exit: function (node) {
var tagExpr = node.name;
var args = [];
@@ -81,13 +81,12 @@ exports.XJSOpeningElement = {
exports.XJSElement = {
exit: function (node) {
var callExpr = node.openingElement;
var children = node.children;
var childrenToRender = node.children.filter(function(child) {
return !(t.isLiteral(child) && _.isString(child.value) && child.value.match(/^[ \t]*[\r\n][ \t\r\n]*$/));
});
_.each(childrenToRender, function (child, i) {
_.each(childrenToRender, function (child) {
callExpr.arguments.push(child);
});