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

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

Issue 20742002: Clean up error handling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added documentation guide lines. Created 7 years, 5 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/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
index c2791c860af7ab125d2c0dca66dd504868524676..763c1e154007e9fab759f843ec8cfcce17a6c6ac 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
@@ -17,6 +17,7 @@ import '../dart2jslib.dart' show invariant,
DartType,
TypeVariableType,
TypedefType,
+ DualKind,
MessageKind,
DiagnosticListener,
Script,
@@ -362,7 +363,7 @@ class AmbiguousElementX extends ElementX implements AmbiguousElement {
/**
* The message to report on resolving this element.
*/
- final MessageKind messageKind;
+ final DualKind messageKind;
/**
* The message arguments to report on resolving this element.
@@ -435,8 +436,8 @@ class ScopeX {
} else {
Element existing = contents.putIfAbsent(name, () => element);
if (!identical(existing, element)) {
- listener.reportErrorCode(element,
- MessageKind.DUPLICATE_DEFINITION, {'name': name});
+ listener.reportError(
+ element, MessageKind.DUPLICATE_DEFINITION, {'name': name});
listener.reportMessage(
listener.spanFromSpannable(existing),
MessageKind.EXISTING_DEFINITION.error({'name': name}),
@@ -539,7 +540,7 @@ class CompilationUnitElementX extends ElementX
return;
}
if (!localMembers.isEmpty) {
- listener.reportErrorCode(tag, MessageKind.BEFORE_TOP_LEVEL);
+ listener.reportError(tag, MessageKind.BEFORE_TOP_LEVEL);
return;
}
if (partTag != null) {
@@ -1377,7 +1378,7 @@ class ConstructorBodyElementX extends FunctionElementX
bool isInstanceMember() => true;
FunctionType computeType(Compiler compiler) {
- compiler.reportFatalError('Internal error: $this.computeType', this);
+ compiler.internalErrorOnElement(this, '$this.computeType.');
}
Node parseNode(DiagnosticListener listener) {

Powered by Google App Engine
This is Rietveld 408576698