move shadow function visitors to entrance instead of exit

This commit is contained in:
Sebastian McKenzie
2015-05-08 23:33:20 +01:00
parent f0bfdfb699
commit 920c84a1f2
2 changed files with 15 additions and 19 deletions

View File

@@ -89,21 +89,17 @@ export var metadata = {
group: "builtin-trailing"
};
export var Program = {
exit(node, parent, scope) {
aliasFunction(function () {
return node.body;
}, this, scope);
}
};
export function Program(node, parent, scope) {
aliasFunction(function () {
return node.body;
}, this, scope);
}
export var FunctionDeclaration = {
exit(node, parent, scope) {
aliasFunction(function () {
t.ensureBlock(node);
return node.body.body;
}, this, scope);
}
};
export function FunctionDeclaration(node, parent, scope) {
aliasFunction(function () {
t.ensureBlock(node);
return node.body.body;
}, this, scope);
}
export { FunctionDeclaration as FunctionExpression };

View File

@@ -11,17 +11,17 @@ function one() {
one(1, 2);
function two() {
var _arguments3 = arguments;
var _arguments2 = arguments;
var inner = function inner() {
return _arguments3;
return _arguments2;
};
var another = function another() {
var _arguments2 = arguments;
var _arguments3 = arguments;
var inner2 = function inner2() {
return _arguments2;
return _arguments3;
};
};