Chromium Code Reviews| 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 // Javascript preamble, that lets the output of dart2js run on V8's d8 shell. | 5 // Javascript preamble, that lets the output of dart2js run on V8's d8 shell. |
| 6 | 6 |
| 7 // Node wraps files and provides them with a different `this`. The global | 7 // Node wraps files and provides them with a different `this`. The global |
| 8 // `this` can be accessed through `global`. | 8 // `this` can be accessed through `global`. |
| 9 | 9 |
| 10 var self = this; | 10 var self = this; |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 272 self.dartMainRunner = function(main, args) { | 272 self.dartMainRunner = function(main, args) { |
| 273 // Initialize. | 273 // Initialize. |
| 274 var action = function() { main(args); } | 274 var action = function() { main(args); } |
| 275 eventLoop(action); | 275 eventLoop(action); |
| 276 }; | 276 }; |
| 277 self.setTimeout = addTimer; | 277 self.setTimeout = addTimer; |
| 278 self.clearTimeout = cancelTimer; | 278 self.clearTimeout = cancelTimer; |
| 279 self.setInterval = addInterval; | 279 self.setInterval = addInterval; |
| 280 self.clearInterval = cancelTimer; | 280 self.clearInterval = cancelTimer; |
| 281 self.scheduleImmediate = addTask; | 281 self.scheduleImmediate = addTask; |
| 282 self.self = self; | 282 self.self = self; |
|
floitsch
2015/02/25 16:00:00
Create a "section" (with a comment).
Keep 'self.s
sigurdm
2015/02/26 13:19:05
Done.
| |
| 283 self.dartDeferredLibraryLoader = | |
| 284 function(uri, successCallback, errorCallback) { | |
| 285 try { | |
| 286 (new Function(load(uri)))(); | |
|
Lasse Reichstein Nielsen
2015/02/26 08:44:09
What is the "new Function" supposed to do?
I think
sigurdm
2015/02/26 13:19:05
Yes, I realized that this morning also.
| |
| 287 successCallback(); | |
| 288 } catch (error) { | |
| 289 errorCallback(error); | |
| 290 } | |
| 291 }; | |
| 283 })(self); | 292 })(self); |
| OLD | NEW |