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

Unified Diff: sdk/lib/_internal/compiler/js_lib/preambles/jsshell.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/jsshell.js
diff --git a/sdk/lib/_internal/compiler/js_lib/preambles/jsshell.js b/sdk/lib/_internal/compiler/js_lib/preambles/jsshell.js
index 8f13bcc8f28fefa1adcad3488d1746cf590c35c1..51c29ad9f0ff1873a70a2aaa1779e4e1f999a540 100644
--- a/sdk/lib/_internal/compiler/js_lib/preambles/jsshell.js
+++ b/sdk/lib/_internal/compiler/js_lib/preambles/jsshell.js
@@ -16,4 +16,15 @@
// Global properties. "self" refers to the global object, so adding a
// property to "self" defines a global variable.
self.self = self;
+
+ self.dartDeferredLibraryLoader =
+ function(uri, successCallback, errorCallback) {
+ print("Loading "+uri);
floitsch 2015/02/25 16:00:00 Remove?
sigurdm 2015/02/26 13:19:05 Done.
+ try {
+ (new Function(load(uri)))();
Lasse Reichstein Nielsen 2015/02/26 08:44:09 Remove Function here too.
sigurdm 2015/02/26 13:19:05 Done.
+ successCallback();
+ } catch (error) {
+ errorCallback(error);
+ }
+ };
})(this)

Powered by Google App Engine
This is Rietveld 408576698