| Index: dart/lib/compiler/compiler.dart
|
| diff --git a/dart/lib/compiler/compiler.dart b/dart/lib/compiler/compiler.dart
|
| index 29f1d85e1a884be9f7bc705cf01cc96fbcc87092..3a15caf59805a600664f56a894ee3cc784a6d7e5 100644
|
| --- a/dart/lib/compiler/compiler.dart
|
| +++ b/dart/lib/compiler/compiler.dart
|
| @@ -29,7 +29,7 @@ typedef Future<String> ReadStringFromUri(Uri uri);
|
| * diagnostic it is.
|
| */
|
| typedef void DiagnosticHandler(Uri uri, int begin, int end,
|
| - String message, var kind);
|
| + String message, Diagnostic kind);
|
|
|
| /**
|
| * Returns a future that completes to [script] compiled to JavaScript. If
|
| @@ -71,34 +71,34 @@ class Diagnostic {
|
| * This means that the compiler can generate code that when executed
|
| * terminates execution.
|
| */
|
| - static final Diagnostic ERROR = const Diagnostic(1);
|
| + static final Diagnostic ERROR = const Diagnostic(1, 'error');
|
|
|
| /**
|
| * A warning as identified by the "Dart Programming Language
|
| * Specification" [http://www.dartlang.org/docs/spec/].
|
| */
|
| - static final Diagnostic WARNING = const Diagnostic(2);
|
| + static final Diagnostic WARNING = const Diagnostic(2, 'warning');
|
|
|
| /**
|
| * Any other warning that is not covered by [WARNING].
|
| */
|
| - static final Diagnostic LINT = const Diagnostic(4);
|
| + static final Diagnostic LINT = const Diagnostic(4, 'lint');
|
|
|
| /**
|
| * Informational messages.
|
| */
|
| - static final Diagnostic INFO = const Diagnostic(8);
|
| + static final Diagnostic INFO = const Diagnostic(8, 'info');
|
|
|
| /**
|
| * Informational messages that shouldn't be printed unless
|
| * explicitly requested by the user of a compiler.
|
| */
|
| - static final Diagnostic VERBOSE_INFO = const Diagnostic(16);
|
| + static final Diagnostic VERBOSE_INFO = const Diagnostic(16, 'verbose info');
|
|
|
| /**
|
| * An internal error in the compiler.
|
| */
|
| - static final Diagnostic CRASH = const Diagnostic(32);
|
| + static final Diagnostic CRASH = const Diagnostic(32, 'crash');
|
|
|
| /**
|
| * An [int] representation of this kind. The ordinals are designed
|
| @@ -107,8 +107,15 @@ class Diagnostic {
|
| final int ordinal;
|
|
|
| /**
|
| + * The name of this kind.
|
| + */
|
| + final String name;
|
| +
|
| + /**
|
| * This constructor is not private to support user-defined
|
| * diagnostic kinds.
|
| */
|
| - const Diagnostic(this.ordinal);
|
| + const Diagnostic(this.ordinal, this.name);
|
| +
|
| + String toString() => name;
|
| }
|
|
|