move transformers over to using ast-types when constructing new nodes

This commit is contained in:
Sebastian McKenzie
2014-10-01 11:01:49 +10:00
parent 91737fc84b
commit 05c037d2d4
12 changed files with 95 additions and 138 deletions

View File

@@ -1,5 +1,7 @@
var util = require("../util");
var b = require("ast-types").builders;
exports.FunctionDeclaration =
exports.FunctionExpression = function (node) {
if (!node.rest) return;
@@ -11,9 +13,6 @@ exports.FunctionExpression = function (node) {
node.body.body.unshift(util.template(templateName, {
VARIABLE_NAME: rest,
SLICE_ARG: {
type: "Literal",
value: node.params.length
}
SLICE_ARG: b.literal(node.params.length)
}));
};