move shadow function visitors to entrance instead of exit
This commit is contained in:
@@ -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 };
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user