| 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 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 return element; | 1467 return element; |
| 1468 } | 1468 } |
| 1469 | 1469 |
| 1470 ConstructorElement _unnamedListConstructor; | 1470 ConstructorElement _unnamedListConstructor; |
| 1471 ConstructorElement get unnamedListConstructor => | 1471 ConstructorElement get unnamedListConstructor => |
| 1472 _unnamedListConstructor ??= listClass.lookupDefaultConstructor(); | 1472 _unnamedListConstructor ??= listClass.lookupDefaultConstructor(); |
| 1473 | 1473 |
| 1474 ConstructorElement _filledListConstructor; | 1474 ConstructorElement _filledListConstructor; |
| 1475 ConstructorElement get filledListConstructor => | 1475 ConstructorElement get filledListConstructor => |
| 1476 _filledListConstructor ??= listClass.lookupConstructor("filled"); | 1476 _filledListConstructor ??= listClass.lookupConstructor("filled"); |
| 1477 |
| 1478 // TODO(johnniwinther): Change types to `ClassElement` when these are not |
| 1479 // called with unrelated elements. |
| 1480 bool isNumberOrStringSupertype(/*Class*/ Element element) { |
| 1481 return element == coreLibrary.find('Comparable'); |
| 1482 } |
| 1483 |
| 1484 bool isStringOnlySupertype(/*Class*/ Element element) { |
| 1485 return element == coreLibrary.find('Pattern'); |
| 1486 } |
| 1487 |
| 1488 bool isListSupertype(/*Class*/ Element element) => element == iterableClass; |
| 1477 } | 1489 } |
| 1478 | 1490 |
| 1479 class CompilerDiagnosticReporter extends DiagnosticReporter { | 1491 class CompilerDiagnosticReporter extends DiagnosticReporter { |
| 1480 final Compiler compiler; | 1492 final Compiler compiler; |
| 1481 final DiagnosticOptions options; | 1493 final DiagnosticOptions options; |
| 1482 | 1494 |
| 1483 Element _currentElement; | 1495 Element _currentElement; |
| 1484 bool hasCrashed = false; | 1496 bool hasCrashed = false; |
| 1485 | 1497 |
| 1486 /// `true` if the last diagnostic was filtered, in which case the | 1498 /// `true` if the last diagnostic was filtered, in which case the |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2212 _ElementScanner(this.scanner); | 2224 _ElementScanner(this.scanner); |
| 2213 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); | 2225 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); |
| 2214 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); | 2226 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); |
| 2215 } | 2227 } |
| 2216 | 2228 |
| 2217 class _EmptyEnvironment implements Environment { | 2229 class _EmptyEnvironment implements Environment { |
| 2218 const _EmptyEnvironment(); | 2230 const _EmptyEnvironment(); |
| 2219 | 2231 |
| 2220 String valueOf(String key) => null; | 2232 String valueOf(String key) => null; |
| 2221 } | 2233 } |
| OLD | NEW |