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

Unified Diff: dart/pkg/template_binding/lib/src/instance_binding_map.dart

Issue 336013003: Version 1.5.0-dev.4.14 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 6 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/pkg/template_binding/lib/src/instance_binding_map.dart
===================================================================
--- dart/pkg/template_binding/lib/src/instance_binding_map.dart (revision 37358)
+++ dart/pkg/template_binding/lib/src/instance_binding_map.dart (working copy)
@@ -71,3 +71,17 @@
_processBindings(clone, bindings, model, instanceBindings);
return clone;
}
+
+// TODO(rafaelw): Setup a MutationObserver on content which clears the expando
+// so that bindingMaps regenerate when template.content changes.
+_getInstanceBindingMap(DocumentFragment content, BindingDelegate delegate) {
+ if (delegate == null) delegate = BindingDelegate._DEFAULT;
+
+ if (delegate._bindingMaps == null) delegate._bindingMaps = new Expando();
+ var map = delegate._bindingMaps[content];
+ if (map == null) {
+ map = _createInstanceBindingMap(content, delegate);
+ delegate._bindingMaps[content] = map;
+ }
+ return map;
+}
« no previous file with comments | « dart/pkg/template_binding/lib/src/input_element.dart ('k') | dart/pkg/template_binding/lib/src/mustache_tokens.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698