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

Unified 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, 10 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/js_lib/preambles/d8.js
diff --git a/sdk/lib/_internal/compiler/js_lib/preambles/d8.js b/sdk/lib/_internal/compiler/js_lib/preambles/d8.js
index aed01611236ecf870687224cf08f78c8f0dc32fb..ee58aa6b49312385408ce50380d26406ba306fa2 100644
--- a/sdk/lib/_internal/compiler/js_lib/preambles/d8.js
+++ b/sdk/lib/_internal/compiler/js_lib/preambles/d8.js
@@ -280,4 +280,13 @@ if (typeof global != "undefined") self = global; // Node.js.
self.clearInterval = cancelTimer;
self.scheduleImmediate = addTask;
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.
+ self.dartDeferredLibraryLoader =
+ function(uri, successCallback, errorCallback) {
+ try {
+ (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.
+ successCallback();
+ } catch (error) {
+ errorCallback(error);
+ }
+ };
})(self);

Powered by Google App Engine
This is Rietveld 408576698