UNPKG

559 BJavaScriptView Raw
1var ExpressionStatement = module.exports = function(expression) {
2 this.type = 'ExpressionStatement';
3 this.expression = expression;
4};
5
6ExpressionStatement.prototype.normalize = function (place) {
7 var expression = this.expression;
8 if (expression.type === 'CallExpression') {
9 if (expression.callee.type === 'FunctionExpression') {
10 expression.callee.body.normalize();
11 }
12 expression.arguments.forEach(function (arg) {
13 if (arg.type === 'FunctionExpression') {
14 arg.body.normalize();
15 }
16 });
17 }
18 place.push(this);
19};