| Index: dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart
|
| diff --git a/dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart b/dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart
|
| index e78ada21ba3831202028d782be75ae61349ea01d..c9ebde7192232bc1a8addf2876697a5fe18a68f2 100644
|
| --- a/dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart
|
| +++ b/dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart
|
| @@ -177,7 +177,9 @@ class Compiler extends leg.Compiler {
|
| if (node != null) {
|
| cancel("$exception", node: node);
|
| } else {
|
| - reportDiagnostic(null, "$exception", api.Diagnostic.ERROR);
|
| + reportError(
|
| + null,
|
| + leg.MessageKind.GENERIC, {'text': 'Error: $exception'});
|
| throw new leg.CompilerCancelledException("$exception");
|
| }
|
| }
|
| @@ -219,24 +221,32 @@ class Compiler extends leg.Compiler {
|
| }
|
| if (!allowInternalLibraryAccess) {
|
| if (node != null && importingLibrary != null) {
|
| - reportDiagnostic(spanFromNode(node),
|
| - 'Error: Internal library $resolvedUri is not accessible from '
|
| - '${importingLibrary.canonicalUri}.',
|
| - api.Diagnostic.ERROR);
|
| + reportError(
|
| + node,
|
| + leg.MessageKind.GENERIC,
|
| + {'text':
|
| + 'Error: Internal library $resolvedUri is not accessible from '
|
| + '${importingLibrary.canonicalUri}.'});
|
| } else {
|
| - reportDiagnostic(null,
|
| - 'Error: Internal library $resolvedUri is not accessible.',
|
| - api.Diagnostic.ERROR);
|
| + reportError(
|
| + null,
|
| + leg.MessageKind.GENERIC,
|
| + {'text':
|
| + 'Error: Internal library $resolvedUri is not accessible.'});
|
| }
|
| - //path = null;
|
| }
|
| }
|
| if (path == null) {
|
| if (node != null) {
|
| - reportError(node, 'library not found ${resolvedUri}');
|
| + reportError(
|
| + node,
|
| + leg.MessageKind.GENERIC,
|
| + {'text': 'Error: Library not found ${resolvedUri}.'});
|
| } else {
|
| - reportDiagnostic(null, 'library not found ${resolvedUri}',
|
| - api.Diagnostic.ERROR);
|
| + reportError(
|
| + null,
|
| + leg.MessageKind.GENERIC,
|
| + {'text': 'Error: Library not found ${resolvedUri}.'});
|
| }
|
| return null;
|
| }
|
| @@ -257,16 +267,8 @@ class Compiler extends leg.Compiler {
|
|
|
| Uri translatePackageUri(Uri uri, tree.Node node) {
|
| if (packageRoot == null) {
|
| - if (node != null) {
|
| - reportErrorCode(node,
|
| - leg.MessageKind.PACKAGE_ROOT_NOT_SET,
|
| - {'uri': uri});
|
| - } else {
|
| - reportDiagnostic(null,
|
| - leg.MessageKind.PACKAGE_ROOT_NOT_SET.error({'uri': uri}).toString(),
|
| - api.Diagnostic.ERROR);
|
| - }
|
| - throw new leg.CompilerCancelledException("Package root not set.");
|
| + reportFatalError(
|
| + node, leg.MessageKind.PACKAGE_ROOT_NOT_SET, {'uri': uri});
|
| }
|
| return packageRoot.resolve(uri.path);
|
| }
|
|
|