From e3b9a0dd384de81b8f520530d7ee9fcecf961620 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 3 Nov 2014 21:16:15 +1100 Subject: [PATCH] update alias-functions transformer to use types --- lib/6to5/transformers/_alias-functions.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/6to5/transformers/_alias-functions.js b/lib/6to5/transformers/_alias-functions.js index 174e9355c0..91261d1799 100644 --- a/lib/6to5/transformers/_alias-functions.js +++ b/lib/6to5/transformers/_alias-functions.js @@ -1,17 +1,16 @@ var traverse = require("../traverse"); var t = require("../types"); -var b = require("../builders"); var go = function (getBody, node, file) { var argumentsId; var thisId; var getArgumentsId = function () { - return argumentsId = argumentsId || b.identifier(file.generateUid("arguments")); + return argumentsId = argumentsId || t.identifier(file.generateUid("arguments")); }; var getThisId = function () { - return thisId = thisId || b.identifier(file.generateUid("this")); + return thisId = thisId || t.identifier(file.generateUid("this")); }; // traverse the function and find all alias functions so we can alias @@ -57,17 +56,17 @@ var go = function (getBody, node, file) { var pushDeclaration = function (id, init) { body = body || getBody(); - body.unshift(b.variableDeclaration("var", [ - b.variableDeclarator(id, init) + body.unshift(t.variableDeclaration("var", [ + t.variableDeclarator(id, init) ])); }; if (argumentsId) { - pushDeclaration(argumentsId, b.identifier("arguments")); + pushDeclaration(argumentsId, t.identifier("arguments")); } if (thisId) { - pushDeclaration(thisId, b.identifier("this")); + pushDeclaration(thisId, t.identifier("this")); } };