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

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

Issue 9646030: Find diagnostic locations for use in new compiler API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix crashes and address review comments Created 8 years, 9 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
Index: dart/frog/leg/elements/elements.dart
diff --git a/dart/frog/leg/elements/elements.dart b/dart/frog/leg/elements/elements.dart
index 7c527ebdc9ba18df1d38e9e8803afd31c4d86d2a..46aa4658fe81e3c4493409d7ad69663c72b1ffef 100644
--- a/dart/frog/leg/elements/elements.dart
+++ b/dart/frog/leg/elements/elements.dart
@@ -555,24 +555,7 @@ class SynthesizedConstructorElement extends FunctionElement {
: super(enclosing.name, ElementKind.GENERATIVE_CONSTRUCTOR,
null, enclosing);
- FunctionType computeType(Compiler compiler) {
- if (type != null) return type;
- Type returnType = compiler.types.voidType;
- type = new FunctionType(returnType, const EmptyLink<Type>(), this);
- return type;
- }
-
- Node parseNode(DiagnosticListener listener) {
- if (cachedNode != null) return cachedNode;
- cachedNode = new FunctionExpression(
- new Identifier(enclosingElement.position()),
- new NodeList.empty(),
- new Block(new NodeList.empty()),
- null, null, null, null);
- return cachedNode;
- }
-
- Token position() => null;
+ Token position() => enclosing.position();
}
class ClassElement extends ContainerElement {
@@ -587,7 +570,6 @@ class ClassElement extends ContainerElement {
// backendMembers are members that have been added by the backend to simplify
// compilation. They don't have any user-side counter-part.
Link<Element> backendMembers = const EmptyLink<Element>();
- SynthesizedConstructorElement synthesizedConstructor;
Link<Type> allSupertypes;
@@ -688,18 +670,6 @@ class ClassElement extends ContainerElement {
return result;
}
- 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);
- }
- return synthesizedConstructor;
- }
-
/**
* Returns the super class, if any.
*

Powered by Google App Engine
This is Rietveld 408576698