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

Unified Diff: sdk/lib/_internal/compiler/implementation/elements/modelx.dart

Issue 206193002: Remove cancel and make crash exit with code 253. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 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: sdk/lib/_internal/compiler/implementation/elements/modelx.dart
diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
index eb48b99e04a22800f2bd563b2ab8db66228b09dc..23237ef888fa3544e0d52710a14f0b3a97abcb7b 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
@@ -48,12 +48,12 @@ abstract class ElementX implements Element {
Modifiers get modifiers => Modifiers.EMPTY;
Node parseNode(DiagnosticListener listener) {
- listener.internalErrorOnElement(this, 'not implemented');
+ listener.internalError(this, 'Not implemented.');
return null;
}
DartType computeType(Compiler compiler) {
- compiler.internalError("$this.computeType.", token: position());
+ compiler.internalError(this, "$this.computeType.");
return null;
}
@@ -542,10 +542,13 @@ class ScopeX {
Element existing,
DiagnosticListener listener) {
void reportError(Element other) {
- // TODO(ahe): Do something similar to Resolver.reportErrorWithContext.
- listener.cancel('duplicate definition of ${accessor.name}',
- element: accessor);
- listener.cancel('existing definition', element: other);
+ listener.reportError(accessor,
+ MessageKind.DUPLICATE_DEFINITION,
+ {'name': accessor.name});
+ // TODO(johnniwinther): Make this an info instead of a fatal error.
+ listener.reportFatalError(other,
+ MessageKind.EXISTING_DEFINITION,
+ {'name': accessor.name});
}
if (existing != null) {
@@ -1186,8 +1189,8 @@ class VariableElementX extends ElementX with AnalyzableElement
count++;
}
if (node == null) {
- listener.cancel('internal error: could not find $name',
- node: definitions);
+ listener.internalError(definitions,
+ "Could not find '$name'.");
}
if (count == 1) {
definitionsCache = definitions;
@@ -1618,8 +1621,8 @@ class FunctionElementX extends ElementX with AnalyzableElement
FunctionExpression parseNode(DiagnosticListener listener) {
if (patch == null) {
if (modifiers.isExternal()) {
- listener.cancel("Compiling external function with no implementation.",
- element: this);
+ listener.internalError(this,
+ "Compiling external function with no implementation.");
}
}
return cachedNode;
@@ -1671,7 +1674,7 @@ class ConstructorBodyElementX extends FunctionElementX
bool isInstanceMember() => true;
FunctionType computeType(Compiler compiler) {
- compiler.internalErrorOnElement(this, '$this.computeType.');
+ compiler.internalError(this, '$this.computeType.');
return null;
}
@@ -2384,11 +2387,11 @@ class MixinApplicationElementX extends BaseClassElementX
}
void addMember(Element element, DiagnosticListener listener) {
- throw new UnsupportedError("cannot add member to $this");
+ throw new UnsupportedError("Cannot add member to $this.");
}
void addToScope(Element element, DiagnosticListener listener) {
- listener.internalError('cannot add to scope of $this', element: this);
+ listener.internalError(this, 'Cannot add to scope of $this.');
}
void addConstructor(FunctionElement constructor) {

Powered by Google App Engine
This is Rietveld 408576698