| 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:io'; | 7 import 'dart:io'; |
| 8 import 'dart:uri'; | 8 import 'dart:uri'; |
| 9 | 9 |
| 10 import '../../../../../lib/compiler/compiler.dart' as diagnostics; | 10 import '../../../../../lib/compiler/compiler.dart' as diagnostics; |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 class Dart2JsLibraryMirror extends Dart2JsObjectMirror | 475 class Dart2JsLibraryMirror extends Dart2JsObjectMirror |
| 476 implements LibraryMirror { | 476 implements LibraryMirror { |
| 477 Map<String, InterfaceMirror> _types; | 477 Map<String, InterfaceMirror> _types; |
| 478 Map<String, MemberMirror> _members; | 478 Map<String, MemberMirror> _members; |
| 479 | 479 |
| 480 Dart2JsLibraryMirror(Dart2JsMirrorSystem system, LibraryElement library) | 480 Dart2JsLibraryMirror(Dart2JsMirrorSystem system, LibraryElement library) |
| 481 : super(system, library); | 481 : super(system, library); |
| 482 | 482 |
| 483 LibraryElement get _library => _element; | 483 LibraryElement get _library => _element; |
| 484 | 484 |
| 485 Uri get uri => _library.uri; |
| 486 |
| 485 LibraryMirror library() => this; | 487 LibraryMirror library() => this; |
| 486 | 488 |
| 487 /** | 489 /** |
| 488 * Returns the library name (for libraries with a #library tag) or the script | 490 * Returns the library name (for libraries with a #library tag) or the script |
| 489 * file name (for scripts without a #library tag). The latter case is used to | 491 * file name (for scripts without a #library tag). The latter case is used to |
| 490 * provide a 'library name' for scripts, to use for instance in dartdoc. | 492 * provide a 'library name' for scripts, to use for instance in dartdoc. |
| 491 */ | 493 */ |
| 492 String get simpleName { | 494 String get simpleName { |
| 493 if (_library.libraryTag !== null) { | 495 if (_library.libraryTag !== null) { |
| 494 // TODO(ahe): Remove StringNode check when old syntax is removed. | 496 // TODO(ahe): Remove StringNode check when old syntax is removed. |
| (...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1389 if (node !== null) { | 1391 if (node !== null) { |
| 1390 var span = system.compiler.spanFromNode(node, script.uri); | 1392 var span = system.compiler.spanFromNode(node, script.uri); |
| 1391 return new Dart2JsLocation(script, span); | 1393 return new Dart2JsLocation(script, span); |
| 1392 } else { | 1394 } else { |
| 1393 var span = system.compiler.spanFromElement(_variable); | 1395 var span = system.compiler.spanFromElement(_variable); |
| 1394 return new Dart2JsLocation(script, span); | 1396 return new Dart2JsLocation(script, span); |
| 1395 } | 1397 } |
| 1396 } | 1398 } |
| 1397 } | 1399 } |
| 1398 | 1400 |
| OLD | NEW |