| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 dart._js_mirrors; | 5 library dart._js_mirrors; |
| 6 | 6 |
| 7 import 'shared/runtime_data.dart' as encoding; | 7 import 'shared/runtime_data.dart' as encoding; |
| 8 import 'shared/embedded_names.dart' show | 8 import 'shared/embedded_names.dart' show |
| 9 ALL_CLASSES, | 9 ALL_CLASSES, |
| 10 LAZIES, | 10 LAZIES, |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 this._isRoot, | 339 this._isRoot, |
| 340 this._globalObject) | 340 this._globalObject) |
| 341 : super(simpleName) { | 341 : super(simpleName) { |
| 342 preserveLibraryNames(); | 342 preserveLibraryNames(); |
| 343 } | 343 } |
| 344 | 344 |
| 345 String get _prettyName => 'LibraryMirror'; | 345 String get _prettyName => 'LibraryMirror'; |
| 346 | 346 |
| 347 Uri get uri { | 347 Uri get uri { |
| 348 preserveUris(); | 348 preserveUris(); |
| 349 return _uri; | 349 if (_uri != "") return _uri; |
| 350 // The Uri has been compiled out. Create a URI from the simple name. |
| 351 return new Uri(scheme: "missing", path: n(simpleName)); |
| 350 } | 352 } |
| 351 | 353 |
| 352 Symbol get qualifiedName => simpleName; | 354 Symbol get qualifiedName => simpleName; |
| 353 | 355 |
| 354 List<JsMethodMirror> get _methods => _functionMirrors; | 356 List<JsMethodMirror> get _methods => _functionMirrors; |
| 355 | 357 |
| 356 Map<Symbol, ClassMirror> get __classes { | 358 Map<Symbol, ClassMirror> get __classes { |
| 357 if (_cachedClasses != null) return _cachedClasses; | 359 if (_cachedClasses != null) return _cachedClasses; |
| 358 var result = new Map(); | 360 var result = new Map(); |
| 359 for (String className in _classes) { | 361 for (String className in _classes) { |
| (...skipping 2595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2955 // have a part (following a '.') that starts with '_'. | 2957 // have a part (following a '.') that starts with '_'. |
| 2956 const int UNDERSCORE = 0x5f; | 2958 const int UNDERSCORE = 0x5f; |
| 2957 if (name.isEmpty) return true; | 2959 if (name.isEmpty) return true; |
| 2958 int index = -1; | 2960 int index = -1; |
| 2959 do { | 2961 do { |
| 2960 if (name.codeUnitAt(index + 1) == UNDERSCORE) return false; | 2962 if (name.codeUnitAt(index + 1) == UNDERSCORE) return false; |
| 2961 index = name.indexOf('.', index + 1); | 2963 index = name.indexOf('.', index + 1); |
| 2962 } while (index >= 0 && index + 1 < name.length); | 2964 } while (index >= 0 && index + 1 < name.length); |
| 2963 return true; | 2965 return true; |
| 2964 } | 2966 } |
| OLD | NEW |