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

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

Issue 213713002: Reapply change that makes path-observer more agressive with property lookups. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/template_binding/lib/src/template_iterator.dart
diff --git a/pkg/template_binding/lib/src/template_iterator.dart b/pkg/template_binding/lib/src/template_iterator.dart
index 66d44f5de32de4591f60dc7b845aa976adf699c1..855bf7182b7d154fdb29c5e0a6dd284bc9d0fdc3 100644
--- a/pkg/template_binding/lib/src/template_iterator.dart
+++ b/pkg/template_binding/lib/src/template_iterator.dart
@@ -430,13 +430,23 @@ class _TemplateIterator extends Bindable {
instanceBindings = instance.instanceBindings;
instanceNodes = instance.nodes;
} else {
- instanceBindings = [];
- if (_instanceModelFn != null) {
- model = _instanceModelFn(model);
- }
- if (model != null) {
- fragment = _templateExt.createInstance(model, delegate,
- instanceBindings);
+ try {
+ instanceBindings = [];
+ if (_instanceModelFn != null) {
+ model = _instanceModelFn(model);
+ }
+ if (model != null) {
+ fragment = _templateExt.createInstance(model, delegate,
+ instanceBindings);
+ }
+ } catch (e, s) {
+ // Dart note: we propagate errors asynchronously here to avoid
+ // disrupting the rendering flow. This is different than in the JS
+ // implementation but it should probably be fixed there too. Dart
+ // hits this case more because non-existing properties in
+ // [PropertyPath] are treated as errors, while JS treats them as
+ // null/undefined.
+ new Completer().completeError(e, s);
}
}

Powered by Google App Engine
This is Rietveld 408576698