Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: sdk/lib/_internal/compiler/js_lib/preambles/d8.js

Issue 956953002: Support for a dart2js `dartDeferredLoader` hook. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698