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

Unified Diff: pkg/polymer/lib/src/instance.dart

Issue 105493003: workaround for event handlers: don't return StreamSubscription as model (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 | « pkg/polymer/README.md ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/instance.dart
diff --git a/pkg/polymer/lib/src/instance.dart b/pkg/polymer/lib/src/instance.dart
index 00a50514f459eeb8b9ff6ed291677c79ae710cdf..c0af66c8f2cd8430245e470c9c6d6831439f8f2c 100644
--- a/pkg/polymer/lib/src/instance.dart
+++ b/pkg/polymer/lib/src/instance.dart
@@ -763,10 +763,9 @@ abstract class Polymer implements Element, Observable, NodeBindExtension {
var translated = _eventTranslations[eventName];
eventName = translated != null ? translated : eventName;
- // TODO(jmesserly): returning a StreamSubscription as the model is quite
- // strange. package:template_binding doesn't have any cleanup logic to
- // handle that.
- return node.on[eventName].listen((event) {
+ // TODO(jmesserly): we need a place to unregister this. See:
+ // https://code.google.com/p/dart/issues/detail?id=15574
+ node.on[eventName].listen((event) {
var ctrlr = _findController(node);
if (ctrlr is! Polymer) return;
var obj = ctrlr;
@@ -779,6 +778,10 @@ abstract class Polymer implements Element, Observable, NodeBindExtension {
(event as CustomEvent).detail : null;
ctrlr.dispatchMethod(obj, method, [event, detail, node]);
});
+
+ // TODO(jmesserly): this return value is bogus. Returning null here causes
+ // the wrong thing to happen in template_binding.
+ return new ObservableBox();
};
}
« no previous file with comments | « pkg/polymer/README.md ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698