| 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 file defines the module loader for the dart runtime. | 5 /* This file defines the module loader for the dart runtime. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 var dart_library = | 8 var dart_library = |
| 9 typeof module != "undefined" && module.exports || {}; | 9 typeof module != "undefined" && module.exports || {}; |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 LibraryLoader.READY = 2; | 77 LibraryLoader.READY = 2; |
| 78 | 78 |
| 79 // Map from name to LibraryLoader | 79 // Map from name to LibraryLoader |
| 80 let libraries = new Map(); | 80 let libraries = new Map(); |
| 81 dart_library.libraries = function() { return libraries.keys(); }; | 81 dart_library.libraries = function() { return libraries.keys(); }; |
| 82 dart_library.debuggerLibraries = function() { | 82 dart_library.debuggerLibraries = function() { |
| 83 var debuggerLibraries = []; | 83 var debuggerLibraries = []; |
| 84 libraries.forEach(function (value, key, map) { | 84 libraries.forEach(function (value, key, map) { |
| 85 debuggerLibraries.push(value.load()); | 85 debuggerLibraries.push(value.load()); |
| 86 }); | 86 }); |
| 87 debuggerLibraries.__proto__ = null; |
| 87 return debuggerLibraries; | 88 return debuggerLibraries; |
| 88 }; | 89 }; |
| 89 | 90 |
| 90 function library(name, defaultValue, imports, loader) { | 91 function library(name, defaultValue, imports, loader) { |
| 91 let result = new LibraryLoader(name, defaultValue, imports, loader); | 92 let result = new LibraryLoader(name, defaultValue, imports, loader); |
| 92 libraries.set(name, result); | 93 libraries.set(name, result); |
| 93 return result; | 94 return result; |
| 94 } | 95 } |
| 95 dart_library.library = library; | 96 dart_library.library = library; |
| 96 | 97 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 window.SourceBufferList = new MediaSource().sourceBuffers.constructor; | 155 window.SourceBufferList = new MediaSource().sourceBuffers.constructor; |
| 155 } | 156 } |
| 156 } | 157 } |
| 157 | 158 |
| 158 // This import is only needed for chrome debugging. We should provide an | 159 // This import is only needed for chrome debugging. We should provide an |
| 159 // option to compile without it. | 160 // option to compile without it. |
| 160 dart_sdk._debugger.registerDevtoolsFormatter(); | 161 dart_sdk._debugger.registerDevtoolsFormatter(); |
| 161 } | 162 } |
| 162 | 163 |
| 163 })(dart_library); | 164 })(dart_library); |
| OLD | NEW |