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

Side by Side Diff: pkg/compiler/lib/src/apiimpl.dart

Issue 1415463022: Use DiagnosticMessage in MockCompiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library leg_apiimpl; 5 library leg_apiimpl;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 9
10 import 'package:package_config/packages.dart'; 10 import 'package:package_config/packages.dart';
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 log('Total compile-time ${total}msec;' 492 log('Total compile-time ${total}msec;'
493 ' unaccounted ${total - cumulated}msec'); 493 ' unaccounted ${total - cumulated}msec');
494 return success; 494 return success;
495 }); 495 });
496 }); 496 });
497 } 497 }
498 498
499 void reportDiagnostic(DiagnosticMessage message, 499 void reportDiagnostic(DiagnosticMessage message,
500 List<DiagnosticMessage> infos, 500 List<DiagnosticMessage> infos,
501 api.Diagnostic kind) { 501 api.Diagnostic kind) {
502 // TODO(johnniwinther): Move this to the [DiagnosticReporter]?
503 if (kind == api.Diagnostic.ERROR ||
504 kind == api.Diagnostic.CRASH ||
505 (reporter.options.fatalWarnings &&
506 kind == api.Diagnostic.WARNING)) {
507 compilationFailed = true;
508 }
509 _reportDiagnosticMessage(message, kind); 502 _reportDiagnosticMessage(message, kind);
510 for (DiagnosticMessage info in infos) { 503 for (DiagnosticMessage info in infos) {
511 _reportDiagnosticMessage(info, api.Diagnostic.INFO); 504 _reportDiagnosticMessage(info, api.Diagnostic.INFO);
512 } 505 }
513 } 506 }
514 507
515 void _reportDiagnosticMessage(DiagnosticMessage diagnosticMessage, 508 void _reportDiagnosticMessage(DiagnosticMessage diagnosticMessage,
516 api.Diagnostic kind) { 509 api.Diagnostic kind) {
517 // [:span.uri:] might be [:null:] in case of a [Script] with no [uri]. For 510 // [:span.uri:] might be [:null:] in case of a [Script] with no [uri]. For
518 // instance in the [Types] constructor in typechecker.dart. 511 // instance in the [Types] constructor in typechecker.dart.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 Uri lookupLibraryUri(String libraryName) { 561 Uri lookupLibraryUri(String libraryName) {
569 assert(invariant(NO_LOCATION_SPANNABLE, 562 assert(invariant(NO_LOCATION_SPANNABLE,
570 sdkLibraries != null, message: "setupSdk() has not been run")); 563 sdkLibraries != null, message: "setupSdk() has not been run"));
571 return sdkLibraries[libraryName]; 564 return sdkLibraries[libraryName];
572 } 565 }
573 566
574 Uri resolvePatchUri(String libraryName) { 567 Uri resolvePatchUri(String libraryName) {
575 return backend.resolvePatchUri(libraryName, platformConfigUri); 568 return backend.resolvePatchUri(libraryName, platformConfigUri);
576 } 569 }
577 } 570 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | tests/compiler/dart2js/resolver_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698