Added support for basic case of function literal.

This commit is contained in:
Pavel Talanov
2011-11-18 16:45:53 +04:00
parent 694902103d
commit 7cdfccf2d8
2 changed files with 37 additions and 11 deletions
@@ -276,4 +276,9 @@ public class AstUtil {
public static JsStatement newAssignmentStatement(JsNameRef nameRef, JsExpression expr) {
return convertToStatement(new JsBinaryOperation(JsBinaryOperator.ASG, nameRef, expr));
}
public static JsExpression extractExpressionFromStatement(JsStatement statement) {
assert statement instanceof JsExprStmt : "Cannot extract exprssion form statement: " + statement;
return (((JsExprStmt) statement).getExpression());
}
}