| 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 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1552 return spanFromTokens(node, node); | 1552 return spanFromTokens(node, node); |
| 1553 } else if (node is HInstruction) { | 1553 } else if (node is HInstruction) { |
| 1554 return spanFromHInstruction(node); | 1554 return spanFromHInstruction(node); |
| 1555 } else if (node is Element) { | 1555 } else if (node is Element) { |
| 1556 return spanFromElement(node); | 1556 return spanFromElement(node); |
| 1557 } else if (node is MetadataAnnotation) { | 1557 } else if (node is MetadataAnnotation) { |
| 1558 return node.sourcePosition; | 1558 return node.sourcePosition; |
| 1559 } else if (node is Local) { | 1559 } else if (node is Local) { |
| 1560 Local local = node; | 1560 Local local = node; |
| 1561 return spanFromElement(local.executableContext); | 1561 return spanFromElement(local.executableContext); |
| 1562 } else if (node is Entity) { |
| 1563 return spanFromElement(currentElement); |
| 1562 } else { | 1564 } else { |
| 1563 throw 'No error location.'; | 1565 throw 'No error location.'; |
| 1564 } | 1566 } |
| 1565 } | 1567 } |
| 1566 | 1568 |
| 1567 Element _elementFromHInstruction(HInstruction instruction) { | 1569 Element _elementFromHInstruction(HInstruction instruction) { |
| 1568 return instruction.sourceElement is Element | 1570 return instruction.sourceElement is Element |
| 1569 ? instruction.sourceElement | 1571 ? instruction.sourceElement |
| 1570 : null; | 1572 : null; |
| 1571 } | 1573 } |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1987 _ElementScanner(this.scanner); | 1989 _ElementScanner(this.scanner); |
| 1988 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); | 1990 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); |
| 1989 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); | 1991 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); |
| 1990 } | 1992 } |
| 1991 | 1993 |
| 1992 class _EmptyEnvironment implements Environment { | 1994 class _EmptyEnvironment implements Environment { |
| 1993 const _EmptyEnvironment(); | 1995 const _EmptyEnvironment(); |
| 1994 | 1996 |
| 1995 String valueOf(String key) => null; | 1997 String valueOf(String key) => null; |
| 1996 } | 1998 } |
| OLD | NEW |