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

Unified Diff: tools/dom/src/shared_html.dart

Issue 1894713002: Strong html (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: ptal Created 4 years, 8 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
« no previous file with comments | « tools/dom/src/dart2js_WrappedEvent.dart ('k') | tools/dom/templates/html/impl/impl_Document.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/shared_html.dart
diff --git a/tools/dom/src/shared_html.dart b/tools/dom/src/shared_html.dart
index b6c9c62c9b616ff98025d39ab43c2be08f0bc4e2..27fa2b705f99e634a264b4c1db9e7389ae3794eb 100644
--- a/tools/dom/src/shared_html.dart
+++ b/tools/dom/src/shared_html.dart
@@ -4,17 +4,25 @@
part of dart.dom.html;
-_wrapZone(callback(arg)) {
+// TODO(jacobr): remove these typedefs when dart:async supports generic types.
+typedef R _wrapZoneCallback<A, R>(A a);
+typedef R _wrapZoneBinaryCallback<A, B, R>(A a, B b);
+
+_wrapZoneCallback/*<A, R>*/ _wrapZone/*<A, R>*/(_wrapZoneCallback/*<A, R>*/ callback) {
// For performance reasons avoid wrapping if we are in the root zone.
if (Zone.current == Zone.ROOT) return callback;
if (callback == null) return null;
- return Zone.current.bindUnaryCallback(callback, runGuarded: true);
+ // TODO(jacobr): we cast to _wrapZoneCallback/*<A, R>*/ to hack around missing
+ // generic method support in zones.
+ return Zone.current.bindUnaryCallback(callback, runGuarded: true) as _wrapZoneCallback/*<A, R>*/;
}
-_wrapBinaryZone(callback(arg1, arg2)) {
+_wrapZoneBinaryCallback/*<A, B, R>*/ _wrapBinaryZone/*<A, B, R>*/(_wrapZoneBinaryCallback/*<A, B, R>*/ callback) {
if (Zone.current == Zone.ROOT) return callback;
if (callback == null) return null;
- return Zone.current.bindBinaryCallback(callback, runGuarded: true);
+ // We cast to _wrapZoneBinaryCallback/*<A, B, R>*/ to hack around missing
+ // generic method support in zones.
+ return Zone.current.bindBinaryCallback(callback, runGuarded: true) as _wrapZoneBinaryCallback/*<A, B, R>*/;
}
/**
« no previous file with comments | « tools/dom/src/dart2js_WrappedEvent.dart ('k') | tools/dom/templates/html/impl/impl_Document.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698