| Index: dart/lib/compiler/implementation/tree/nodes.dart
|
| diff --git a/dart/lib/compiler/implementation/tree/nodes.dart b/dart/lib/compiler/implementation/tree/nodes.dart
|
| index 1c158ed0049c365a9849e2a82fd803c6c33e1353..9d0be9eba2addf75035009ed4cfae6484e06f9ef 100644
|
| --- a/dart/lib/compiler/implementation/tree/nodes.dart
|
| +++ b/dart/lib/compiler/implementation/tree/nodes.dart
|
| @@ -635,12 +635,12 @@ class FunctionExpression extends Expression {
|
| if (body != null) body.accept(visitor);
|
| }
|
|
|
| - bool hasBody() {
|
| - // TODO(karlklose,ahe): refactor AST nodes (issue 1713).
|
| - if (body.asReturn() != null) return true;
|
| - NodeList statements = body.asBlock().statements;
|
| - return (!statements.nodes.isEmpty ||
|
| - !identical(statements.getBeginToken().kind, $SEMICOLON));
|
| + bool hasBody() => body.asEmptyStatement() == null;
|
| +
|
| + bool hasEmptyBody() {
|
| + Block block = body.asBlock();
|
| + if (block == null) return false;
|
| + return block.statements.isEmpty;
|
| }
|
|
|
| Token getBeginToken() {
|
|
|