| 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 mirrors_dart2js; | 5 library mirrors_dart2js; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection' show LinkedHashMap; | 8 import 'dart:collection' show LinkedHashMap; |
| 9 | 9 |
| 10 import '../../compiler.dart' as api; | 10 import '../../compiler.dart' as api; |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 | 524 |
| 525 Uri get uri => _library.canonicalUri; | 525 Uri get uri => _library.canonicalUri; |
| 526 | 526 |
| 527 DeclarationMirror get owner => null; | 527 DeclarationMirror get owner => null; |
| 528 | 528 |
| 529 bool get isPrivate => false; | 529 bool get isPrivate => false; |
| 530 | 530 |
| 531 LibraryMirror library() => this; | 531 LibraryMirror library() => this; |
| 532 | 532 |
| 533 /** | 533 /** |
| 534 * Returns the library name (for libraries with a #library tag) or the script | 534 * Returns the library name (for libraries with a library tag) or the script |
| 535 * file name (for scripts without a #library tag). The latter case is used to | 535 * file name (for scripts without a library tag). The latter case is used to |
| 536 * provide a 'library name' for scripts, to use for instance in dartdoc. | 536 * provide a 'library name' for scripts, to use for instance in dartdoc. |
| 537 */ | 537 */ |
| 538 String get simpleName { | 538 String get simpleName { |
| 539 if (_library.libraryTag != null) { | 539 if (_library.libraryTag != null) { |
| 540 // TODO(ahe): Remove StringNode check when old syntax is removed. | 540 // TODO(ahe): Remove StringNode check when old syntax is removed. |
| 541 StringNode name = _library.libraryTag.name.asStringNode(); | 541 StringNode name = _library.libraryTag.name.asStringNode(); |
| 542 if (name != null) { | 542 if (name != null) { |
| 543 return name.dartString.slowToString(); | 543 return name.dartString.slowToString(); |
| 544 } else { | 544 } else { |
| 545 return _library.libraryTag.name.toString(); | 545 return _library.libraryTag.name.toString(); |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1749 * | 1749 * |
| 1750 * All API in this class is experimental. | 1750 * All API in this class is experimental. |
| 1751 */ | 1751 */ |
| 1752 class BackDoor { | 1752 class BackDoor { |
| 1753 /// Return the compilation units comprising [library]. | 1753 /// Return the compilation units comprising [library]. |
| 1754 static List<Mirror> compilationUnitsOf(Dart2JsLibraryMirror library) { | 1754 static List<Mirror> compilationUnitsOf(Dart2JsLibraryMirror library) { |
| 1755 return library._library.compilationUnits.toList().map( | 1755 return library._library.compilationUnits.toList().map( |
| 1756 (cu) => new Dart2JsCompilationUnitMirror(cu, library)).toList(); | 1756 (cu) => new Dart2JsCompilationUnitMirror(cu, library)).toList(); |
| 1757 } | 1757 } |
| 1758 } | 1758 } |
| OLD | NEW |