Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3045)

Unified Diff: dart/lib/compiler/implementation/tree/nodes.dart

Issue 11348037: A method or accessor with empty body is implicitly abstract. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Changes to make unit tests pass Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/lib/compiler/implementation/ssa/builder.dart ('k') | dart/tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « dart/lib/compiler/implementation/ssa/builder.dart ('k') | dart/tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698