| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |