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

Unified Diff: dart/lib/compiler/implementation/elements/elements.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 | « no previous file | dart/lib/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/elements/elements.dart
diff --git a/dart/lib/compiler/implementation/elements/elements.dart b/dart/lib/compiler/implementation/elements/elements.dart
index 5da84bcafd882921018d3d6ec859a86f0c1fb303..82808cf25c6febaf26d3acf80ab81858a944c238 100644
--- a/dart/lib/compiler/implementation/elements/elements.dart
+++ b/dart/lib/compiler/implementation/elements/elements.dart
@@ -353,6 +353,8 @@ class Element implements Spannable {
FunctionElement asFunctionElement() => null;
static bool isInvalid(Element e) => e == null || e.isErroneous();
+
+ bool isAbstract(Compiler compiler) => modifiers.isAbstract();
}
/**
@@ -1184,7 +1186,7 @@ class FunctionElement extends Element {
return type;
}
- Node parseNode(DiagnosticListener listener) {
+ FunctionExpression parseNode(DiagnosticListener listener) {
if (patch == null) {
if (modifiers.isExternal()) {
listener.cancel("Compiling external function with no implementation.",
@@ -1207,6 +1209,15 @@ class FunctionElement extends Element {
return super.toString();
}
}
+
+ bool isAbstract(Compiler compiler) {
+ if (super.isAbstract(compiler)) return true;
+ if (modifiers.isExternal()) return false;
+ if (isFunction() || isAccessor()) {
+ return !parseNode(compiler).hasBody();
+ }
+ return false;
+ }
}
class ConstructorBodyElement extends FunctionElement {
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698