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

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

Issue 17706003: update MDV impl (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged Created 7 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
« no previous file with comments | « no previous file | pkg/mdv/test/template_element_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/mdv/lib/src/bindings.dart
diff --git a/pkg/mdv/lib/src/bindings.dart b/pkg/mdv/lib/src/bindings.dart
index ff8c951834dd1c92256a52598cb1af5171880745..eed0f6af49754c2eb666ba952f675a0dace13768 100644
--- a/pkg/mdv/lib/src/bindings.dart
+++ b/pkg/mdv/lib/src/bindings.dart
@@ -429,7 +429,17 @@ class _TemplateIterator {
}
void _handleChanges(List<ChangeRecord> splices) {
- var syntax = TemplateElement.syntax[_templateElement.attributes['syntax']];
+ var template = _templateElement;
+ var syntax = TemplateElement.syntax[template.attributes['syntax']];
+
+ if (template.parentNode == null || template.document.window == null) {
+ // TODO(jmesserly): this is a little different than the MDV code, which
+ // removes _templateIterator from all instances (via the weak table).
+ // I think it has a similar effect. It might be a no-op.
+ removeAllInstances();
+ abandon();
+ return;
+ }
for (var splice in splices) {
if (splice is! ListChangeRecord) continue;
@@ -463,6 +473,7 @@ class _TemplateIterator {
void abandon() {
unobserve();
_valueBinding.cancel();
+ terminators.clear();
inputs.dispose();
}
}
« no previous file with comments | « no previous file | pkg/mdv/test/template_element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698