| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// This library defines the association between runtime objects and | 5 /// This library defines the association between runtime objects and |
| 6 /// runtime types. | 6 /// runtime types. |
| 7 part of dart._runtime; | 7 part of dart._runtime; |
| 8 | 8 |
| 9 /// Runtime type information. This module defines the mapping from | 9 /// Runtime type information. This module defines the mapping from |
| 10 /// runtime objects to their runtime type information. See the types | 10 /// runtime objects to their runtime type information. See the types |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 void tagComputed(value, compute) { | 201 void tagComputed(value, compute) { |
| 202 JS('', '#(#, #, { get: # })', defineProperty, value, _runtimeType, compute); | 202 JS('', '#(#, #, { get: # })', defineProperty, value, _runtimeType, compute); |
| 203 } | 203 } |
| 204 | 204 |
| 205 void tagLazy(value, compute) { | 205 void tagLazy(value, compute) { |
| 206 JS('', '#(#, #, { get: # })', defineLazyProperty, value, _runtimeType, | 206 JS('', '#(#, #, { get: # })', defineLazyProperty, value, _runtimeType, |
| 207 compute); | 207 compute); |
| 208 } | 208 } |
| 209 | 209 |
| 210 var _loadedModules = JS('', 'new Map()'); | 210 var _loadedModules = JS('', 'new Map()'); |
| 211 var _loadedSourceMaps = JS('', 'new Map()'); |
| 211 | 212 |
| 212 List getModuleNames() { | 213 List getModuleNames() { |
| 213 return JS('', 'Array.from(#.keys())', _loadedModules); | 214 return JS('', 'Array.from(#.keys())', _loadedModules); |
| 214 } | 215 } |
| 215 | 216 |
| 217 String getSourceMap(module) { |
| 218 return JS('String', '#.get(#)', _loadedSourceMaps, module); |
| 219 } |
| 220 |
| 216 /// Return all library objects in the specified module. | 221 /// Return all library objects in the specified module. |
| 217 getModuleLibraries(String name) { | 222 getModuleLibraries(String name) { |
| 218 var module = JS('', '#.get(#)', _loadedModules, name); | 223 var module = JS('', '#.get(#)', _loadedModules, name); |
| 219 if (module == null) return null; | 224 if (module == null) return null; |
| 220 JS('', '#[#] = #', module, _moduleName, name); | 225 JS('', '#[#] = #', module, _moduleName, name); |
| 221 return module; | 226 return module; |
| 222 } | 227 } |
| 223 | 228 |
| 224 /// Track all libraries | 229 /// Track all libraries |
| 225 void trackLibraries(String moduleName, libraries) { | 230 void trackLibraries(String moduleName, libraries, sourceMap) { |
| 231 JS('', '#.set(#, #)', _loadedSourceMaps, moduleName, sourceMap); |
| 226 JS('', '#.set(#, #)', _loadedModules, moduleName, libraries); | 232 JS('', '#.set(#, #)', _loadedModules, moduleName, libraries); |
| 227 } | 233 } |
| OLD | NEW |