remove array comprehension if template as it's nastier than using ast-types

This commit is contained in:
Sebastian McKenzie
2014-10-13 14:11:20 +11:00
parent 964f50bdc8
commit e00ba1d8bb
2 changed files with 2 additions and 11 deletions

View File

@@ -1,3 +0,0 @@
if (STATEMENT) {
}

View File

@@ -1,4 +1,5 @@
var util = require("../util");
var b = require("recast").types.builders;
var _ = require("lodash");
var single = function (node) {
@@ -45,14 +46,7 @@ var multiple = function (node, file) {
// add a filter as this is our final stop
if (node.filter) {
var filter = util.template("if", {
STATEMENT: node.filter
});
// set if body
filter.consequent.body = [child];
child = filter;
var child = b.ifStatement(node.filter, b.blockStatement([child]));
}
}