| 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 dart2js.compiler_base; | 5 library dart2js.compiler_base; |
| 6 | 6 |
| 7 import 'dart:async' show EventSink, Future; | 7 import 'dart:async' show EventSink, Future; |
| 8 | 8 |
| 9 import '../compiler_new.dart' as api; | 9 import '../compiler_new.dart' as api; |
| 10 import 'cache_strategy.dart' show CacheStrategy; | 10 import 'cache_strategy.dart' show CacheStrategy; |
| (...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 /// Associate [element] with a compile-time error [message]. | 1234 /// Associate [element] with a compile-time error [message]. |
| 1235 void registerCompiletimeError(Element element, DiagnosticMessage message) { | 1235 void registerCompiletimeError(Element element, DiagnosticMessage message) { |
| 1236 // The information is only needed if [generateCodeWithCompileTimeErrors]. | 1236 // The information is only needed if [generateCodeWithCompileTimeErrors]. |
| 1237 if (options.generateCodeWithCompileTimeErrors) { | 1237 if (options.generateCodeWithCompileTimeErrors) { |
| 1238 if (element == null) { | 1238 if (element == null) { |
| 1239 // Record as global error. | 1239 // Record as global error. |
| 1240 // TODO(zarah): Extend element model to represent compile-time | 1240 // TODO(zarah): Extend element model to represent compile-time |
| 1241 // errors instead of using a map. | 1241 // errors instead of using a map. |
| 1242 element = mainFunction; | 1242 element = mainFunction; |
| 1243 } | 1243 } |
| 1244 elementsWithCompileTimeErrors. | 1244 elementsWithCompileTimeErrors |
| 1245 putIfAbsent(element, () => <DiagnosticMessage>[]).add(message); | 1245 .putIfAbsent(element, () => <DiagnosticMessage>[]) |
| 1246 .add(message); |
| 1246 } | 1247 } |
| 1247 } | 1248 } |
| 1248 | 1249 |
| 1249 EventSink<String> outputProvider(String name, String extension) { | 1250 EventSink<String> outputProvider(String name, String extension) { |
| 1250 if (compilationFailed) { | 1251 if (compilationFailed) { |
| 1251 if (!options.generateCodeWithCompileTimeErrors || options.testMode) { | 1252 if (!options.generateCodeWithCompileTimeErrors || options.testMode) { |
| 1252 // Disable output in test mode: The build bot currently uses the time | 1253 // Disable output in test mode: The build bot currently uses the time |
| 1253 // stamp of the generated file to determine whether the output is | 1254 // stamp of the generated file to determine whether the output is |
| 1254 // up-to-date. | 1255 // up-to-date. |
| 1255 return new NullSink('$name.$extension'); | 1256 return new NullSink('$name.$extension'); |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2061 _ElementScanner(this.scanner); | 2062 _ElementScanner(this.scanner); |
| 2062 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); | 2063 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); |
| 2063 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); | 2064 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); |
| 2064 } | 2065 } |
| 2065 | 2066 |
| 2066 class _EmptyEnvironment implements Environment { | 2067 class _EmptyEnvironment implements Environment { |
| 2067 const _EmptyEnvironment(); | 2068 const _EmptyEnvironment(); |
| 2068 | 2069 |
| 2069 String valueOf(String key) => null; | 2070 String valueOf(String key) => null; |
| 2070 } | 2071 } |
| OLD | NEW |