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

Unified Diff: dart/frog/leg/elements/elements.dart

Issue 9419009: Use shared implementation of Stopwatch. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: address review comments Created 8 years, 10 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/frog/leg/emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/elements/elements.dart
diff --git a/dart/frog/leg/elements/elements.dart b/dart/frog/leg/elements/elements.dart
index bc34765653118d4866ba7cf7bcedbbb4e27b9b61..b30fd7bf923ee57c614dca670f8dc8cbf7c35af9 100644
--- a/dart/frog/leg/elements/elements.dart
+++ b/dart/frog/leg/elements/elements.dart
@@ -367,26 +367,43 @@ class FunctionElement extends Element {
FunctionParameters functionParameters;
+ /**
+ * If this is an interface constructor, [defaultImplementation] will
+ * changed by the resolver to point to the default
+ * implementation. Otherwise, [:defaultImplementation === this:].
+ */
+ FunctionElement defaultImplementation;
+
FunctionElement(SourceString name,
ElementKind kind,
- Modifiers this.modifiers,
+ Modifiers modifiers,
Element enclosing)
- : super(name, kind, enclosing);
+ : this.tooMuchOverloading(name, null, kind, modifiers, enclosing, null);
FunctionElement.node(SourceString name,
FunctionExpression node,
ElementKind kind,
- Modifiers this.modifiers,
+ Modifiers modifiers,
Element enclosing)
- : super(name, kind, enclosing), cachedNode = node;
+ : this.tooMuchOverloading(name, node, kind, modifiers, enclosing, null);
FunctionElement.from(SourceString name,
FunctionElement other,
Element enclosing)
- : super(name, other.kind, enclosing),
- cachedNode = other.cachedNode,
- modifiers = other.modifiers,
- functionParameters = other.functionParameters;
+ : this.tooMuchOverloading(name, other.cachedNode, other.kind,
+ other.modifiers, enclosing,
+ other.functionParameters);
+
+ FunctionElement.tooMuchOverloading(SourceString name,
+ FunctionExpression this.cachedNode,
+ ElementKind kind,
+ Modifiers this.modifiers,
+ Element enclosing,
+ FunctionParameters this.functionParameters)
+ : super(name, kind, enclosing)
+ {
+ defaultImplementation = this;
+ }
bool isInstanceMember() {
return isMember()
@@ -598,6 +615,9 @@ class ClassElement extends ContainerElement {
bool canHaveDefaultConstructor() => constructors.length == 0;
SynthesizedConstructorElement getSynthesizedConstructor() {
+ // TODO(ahe): Get rid of this method. Add the
+ // SynthesizedConstructorElement to [constructors] if empty when
+ // [resolve] is called.
if (synthesizedConstructor === null && canHaveDefaultConstructor()) {
synthesizedConstructor = new SynthesizedConstructorElement(this);
}
« no previous file with comments | « no previous file | dart/frog/leg/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698