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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart

Issue 12033003: Deferred (aka lazy) loading of static functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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: dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart b/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
index 2c80eaa53140bf0741af00a07796497205109974..72d3f0aa59381eb3d5821d55d6e6ad11d4031c4e 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
@@ -522,6 +522,16 @@ class Primitives {
? JS('bool', '# == null', b)
: JS('bool', '# === #', a, b);
}
+
+ // Used to implement deferred loading. Used as callback on "load"
ahe 2013/02/04 17:46:29 I should be able to move these methods into async_
ahe 2013/02/05 13:54:22 Done.
+ // event by async_patch.dart.
+ static onDeferredLibraryLoadClosure(/* Completer<bool> */ completer, event) {
+ completer.complete(true);
+ }
+
+ static onDeferredLibraryLoad() {
+ return DART_CLOSURE_TO_JS(onDeferredLibraryLoadClosure);
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698