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

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

Issue 1077373003: Add fatal-warnings flag, that turns warnings into compilation errors (the name (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | pkg/compiler/lib/src/dart2js.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8
9 import '../compiler.dart' as api; 9 import '../compiler.dart' as api;
10 import 'dart2jslib.dart' as leg; 10 import 'dart2jslib.dart' as leg;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 buildId: extractStringOption( 75 buildId: extractStringOption(
76 options, '--build-id=', 76 options, '--build-id=',
77 "build number could not be determined"), 77 "build number could not be determined"),
78 showPackageWarnings: 78 showPackageWarnings:
79 hasOption(options, '--show-package-warnings'), 79 hasOption(options, '--show-package-warnings'),
80 useContentSecurityPolicy: hasOption(options, '--csp'), 80 useContentSecurityPolicy: hasOption(options, '--csp'),
81 hasIncrementalSupport: 81 hasIncrementalSupport:
82 forceIncrementalSupport || 82 forceIncrementalSupport ||
83 hasOption(options, '--incremental-support'), 83 hasOption(options, '--incremental-support'),
84 suppressWarnings: hasOption(options, '--suppress-warnings'), 84 suppressWarnings: hasOption(options, '--suppress-warnings'),
85 fatalWarnings: hasOption(options, '--fatal-warnings'),
85 enableExperimentalMirrors: 86 enableExperimentalMirrors:
86 hasOption(options, '--enable-experimental-mirrors'), 87 hasOption(options, '--enable-experimental-mirrors'),
87 generateCodeWithCompileTimeErrors: 88 generateCodeWithCompileTimeErrors:
88 hasOption(options, '--generate-code-with-compile-time-errors'), 89 hasOption(options, '--generate-code-with-compile-time-errors'),
89 allowNativeExtensions: 90 allowNativeExtensions:
90 hasOption(options, '--allow-native-extensions')) { 91 hasOption(options, '--allow-native-extensions')) {
91 tasks.addAll([ 92 tasks.addAll([
92 userHandlerTask = new leg.GenericTask('Diagnostic handler', this), 93 userHandlerTask = new leg.GenericTask('Diagnostic handler', this),
93 userProviderTask = new leg.GenericTask('Input provider', this), 94 userProviderTask = new leg.GenericTask('Input provider', this),
94 ]); 95 ]);
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 ' unaccounted ${total - cumulated}msec'); 348 ' unaccounted ${total - cumulated}msec');
348 return success; 349 return success;
349 }); 350 });
350 } 351 }
351 352
352 void reportDiagnostic(leg.Spannable node, 353 void reportDiagnostic(leg.Spannable node,
353 leg.Message message, 354 leg.Message message,
354 api.Diagnostic kind) { 355 api.Diagnostic kind) {
355 leg.SourceSpan span = spanFromSpannable(node); 356 leg.SourceSpan span = spanFromSpannable(node);
356 if (identical(kind, api.Diagnostic.ERROR) 357 if (identical(kind, api.Diagnostic.ERROR)
357 || identical(kind, api.Diagnostic.CRASH)) { 358 || identical(kind, api.Diagnostic.CRASH)
359 || (fatalWarnings && identical(kind, api.Diagnostic.WARNING))) {
358 compilationFailed = true; 360 compilationFailed = true;
359 } 361 }
360 // [:span.uri:] might be [:null:] in case of a [Script] with no [uri]. For 362 // [:span.uri:] might be [:null:] in case of a [Script] with no [uri]. For
361 // instance in the [Types] constructor in typechecker.dart. 363 // instance in the [Types] constructor in typechecker.dart.
362 if (span == null || span.uri == null) { 364 if (span == null || span.uri == null) {
363 callUserHandler(null, null, null, '$message', kind); 365 callUserHandler(null, null, null, '$message', kind);
364 } else { 366 } else {
365 callUserHandler( 367 callUserHandler(
366 translateUri(null, span.uri), span.begin, span.end, '$message', kind); 368 translateUri(null, span.uri), span.begin, span.end, '$message', kind);
367 } 369 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 print('$message: ${tryToString(exception)}'); 401 print('$message: ${tryToString(exception)}');
400 print(tryToString(stackTrace)); 402 print(tryToString(stackTrace));
401 } 403 }
402 404
403 fromEnvironment(String name) => environment[name]; 405 fromEnvironment(String name) => environment[name];
404 406
405 LibraryInfo lookupLibraryInfo(String libraryName) { 407 LibraryInfo lookupLibraryInfo(String libraryName) {
406 return library_info.LIBRARIES[libraryName]; 408 return library_info.LIBRARIES[libraryName];
407 } 409 }
408 } 410 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | pkg/compiler/lib/src/dart2js.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698