OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 part of service; | 5 part of service; |
6 | 6 |
7 // Some value smaller than the object ring, so requesting a large array | 7 // Some value smaller than the object ring, so requesting a large array |
8 // doesn't result in an expired ref because the elements lapped it in the | 8 // doesn't result in an expired ref because the elements lapped it in the |
9 // object ring. | 9 // object ring. |
10 const int kDefaultFieldLimit = 100; | 10 const int kDefaultFieldLimit = 100; |
(...skipping 2238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2249 map["isImport"], map["isDeferred"], map["prefix"], map["target"]); | 2249 map["isImport"], map["isDeferred"], map["prefix"], map["target"]); |
2250 } | 2250 } |
2251 | 2251 |
2252 class Library extends HeapObject implements M.Library { | 2252 class Library extends HeapObject implements M.Library { |
2253 String uri; | 2253 String uri; |
2254 final dependencies = <LibraryDependency>[]; | 2254 final dependencies = <LibraryDependency>[]; |
2255 final scripts = <Script>[]; | 2255 final scripts = <Script>[]; |
2256 final classes = <Class>[]; | 2256 final classes = <Class>[]; |
2257 final variables = <Field>[]; | 2257 final variables = <Field>[]; |
2258 final functions = <ServiceFunction>[]; | 2258 final functions = <ServiceFunction>[]; |
2259 | 2259 bool _debuggable; |
| 2260 bool get debuggable => _debuggable; |
2260 bool get immutable => false; | 2261 bool get immutable => false; |
2261 | 2262 |
2262 bool isDart(String libraryName) { | 2263 bool isDart(String libraryName) { |
2263 return uri == 'dart:$libraryName'; | 2264 return uri == 'dart:$libraryName'; |
2264 } | 2265 } |
2265 | 2266 |
2266 Library._empty(ServiceObjectOwner owner) : super._empty(owner); | 2267 Library._empty(ServiceObjectOwner owner) : super._empty(owner); |
2267 | 2268 |
2268 void _update(Map map, bool mapIsRef) { | 2269 void _update(Map map, bool mapIsRef) { |
2269 _upgradeCollection(map, isolate); | 2270 _upgradeCollection(map, isolate); |
2270 super._update(map, mapIsRef); | 2271 super._update(map, mapIsRef); |
2271 | 2272 |
2272 uri = map['uri']; | 2273 uri = map['uri']; |
2273 var shortUri = uri; | 2274 var shortUri = uri; |
2274 if (uri.startsWith('file://') || uri.startsWith('http://')) { | 2275 if (uri.startsWith('file://') || uri.startsWith('http://')) { |
2275 shortUri = uri.substring(uri.lastIndexOf('/') + 1); | 2276 shortUri = uri.substring(uri.lastIndexOf('/') + 1); |
2276 } | 2277 } |
2277 name = map['name']; | 2278 name = map['name']; |
2278 if (name.isEmpty) { | 2279 if (name.isEmpty) { |
2279 // When there is no name for a library, use the shortUri. | 2280 // When there is no name for a library, use the shortUri. |
2280 name = shortUri; | 2281 name = shortUri; |
2281 } | 2282 } |
2282 vmName = (map.containsKey('_vmName') ? map['_vmName'] : name); | 2283 vmName = (map.containsKey('_vmName') ? map['_vmName'] : name); |
2283 if (mapIsRef) { | 2284 if (mapIsRef) { |
2284 return; | 2285 return; |
2285 } | 2286 } |
2286 _loaded = true; | 2287 _loaded = true; |
| 2288 _debuggable = map['debuggable']; |
2287 dependencies.clear(); | 2289 dependencies.clear(); |
2288 dependencies.addAll(map["dependencies"].map(LibraryDependency._fromMap)); | 2290 dependencies.addAll(map["dependencies"].map(LibraryDependency._fromMap)); |
2289 scripts.clear(); | 2291 scripts.clear(); |
2290 scripts.addAll(removeDuplicatesAndSortLexical(map['scripts'])); | 2292 scripts.addAll(removeDuplicatesAndSortLexical(map['scripts'])); |
2291 classes.clear(); | 2293 classes.clear(); |
2292 classes.addAll(map['classes']); | 2294 classes.addAll(map['classes']); |
2293 classes.sort(ServiceObject.LexicalSortName); | 2295 classes.sort(ServiceObject.LexicalSortName); |
2294 variables.clear(); | 2296 variables.clear(); |
2295 variables.addAll(map['variables']); | 2297 variables.addAll(map['variables']); |
2296 variables.sort(ServiceObject.LexicalSortName); | 2298 variables.sort(ServiceObject.LexicalSortName); |
(...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4359 var v = list[i]; | 4361 var v = list[i]; |
4360 if ((v is Map) && _isServiceMap(v)) { | 4362 if ((v is Map) && _isServiceMap(v)) { |
4361 list[i] = owner.getFromMap(v); | 4363 list[i] = owner.getFromMap(v); |
4362 } else if (v is List) { | 4364 } else if (v is List) { |
4363 _upgradeList(v, owner); | 4365 _upgradeList(v, owner); |
4364 } else if (v is Map) { | 4366 } else if (v is Map) { |
4365 _upgradeMap(v, owner); | 4367 _upgradeMap(v, owner); |
4366 } | 4368 } |
4367 } | 4369 } |
4368 } | 4370 } |
OLD | NEW |