remove array comprehension if template as it's nastier than using ast-types
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
if (STATEMENT) {
|
||||
|
||||
}
|
||||
@@ -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]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user