alias functions in scope call wrapping - fixes #99
This commit is contained in:
@@ -42,9 +42,11 @@ exports.VariableDeclaration = function (node, parent, file) {
|
||||
if (node.type === "FunctionDeclaration") {
|
||||
throw new Error("`FunctionDeclaration`s that use `let` and `constant` references aren't allowed outside of the root scope");
|
||||
} else {
|
||||
return b.callExpression(b.functionExpression(null, letReferences, b.blockStatement([
|
||||
var func = b.functionExpression(null, letReferences, b.blockStatement([
|
||||
b.returnStatement(node)
|
||||
])), letReferences);
|
||||
]));
|
||||
func._aliasFunction = true;
|
||||
return b.callExpression(func, letReferences);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user