move transformers over to using ast-types when constructing new nodes
This commit is contained in:
@@ -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)
|
||||
}));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user