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

Unified Diff: pkg/mdv/lib/mdv.dart

Issue 22253002: fix packages for latest SDK changes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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: pkg/mdv/lib/mdv.dart
diff --git a/pkg/mdv/lib/mdv.dart b/pkg/mdv/lib/mdv.dart
index 8ba6bf643507f1508c16be29eb2788227dd236ba..7dcb5ab8acb9d9c69c3ed7296c4a87e2e45227cc 100644
--- a/pkg/mdv/lib/mdv.dart
+++ b/pkg/mdv/lib/mdv.dart
@@ -36,7 +36,12 @@ void initialize() {
TemplateElement.mdvPackage = _mdv;
}
-StreamController<DocumentFragment> _instanceCreated;
+
+typedef DocumentFragmentCreated(DocumentFragment fragment);
+
+// TODO(jmesserly): ideally this would be a stream, but they don't allow
+// reentrancy.
+Set<DocumentFragmentCreated> _instanceCreated;
/**
* *Warning*: This is an implementation helper for Model-Driven Views and
@@ -45,15 +50,17 @@ StreamController<DocumentFragment> _instanceCreated;
* This event is fired whenever a template is instantiated via
* [Element.createInstance].
*/
+// TODO(jmesserly): This is a hack, and is neccesary for the polyfill
+// because custom elements are not upgraded during clone()
Siggi Cherem (dart-lang) 2013/08/05 20:20:52 seems the same as the TODO below, remove?
Jennifer Messerly 2013/08/05 20:51:15 Done.
// TODO(rafaelw): This is a hack, and is neccesary for the polyfill
// because custom elements are not upgraded during clone()
// TODO(jmesserly): polymer removed this in:
// https://github.com/Polymer/platform/commit/344ffeaae475babb529403f6608588a0fc73f4e7
-Stream<DocumentFragment> get instanceCreated {
+Set<DocumentFragmentCreated> get instanceCreated {
Siggi Cherem (dart-lang) 2013/08/05 20:20:52 an alternative pattern to consider would be to do
Jennifer Messerly 2013/08/05 20:51:15 yeah, this is basically private API though that sh
if (_instanceCreated == null) {
- _instanceCreated = new StreamController<DocumentFragment>(sync: true);
+ _instanceCreated = new Set<DocumentFragmentCreated>();
}
- return _instanceCreated.stream;
+ return _instanceCreated;
}

Powered by Google App Engine
This is Rietveld 408576698