1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 1 1 518 223 343 3 3 3 3 340 | var t = require("../../types"); exports.BlockStatement = function (node, parent) { if (t.isFunction(parent)) return; node.body = node.body.map(function (node) { if (t.isFunction(node)) { node.type = "FunctionExpression"; var declar = t.variableDeclaration("let", [ t.variableDeclarator(node.id, node) ]); declar._blockHoist = true; return declar; } else { return node; } }); }; |