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

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

Issue 141703024: Refactor of PolymerExpressions. Adds "as" expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments 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/mustache_tokens.dart
diff --git a/pkg/template_binding/lib/src/mustache_tokens.dart b/pkg/template_binding/lib/src/mustache_tokens.dart
index be84d26205cba07597410dc02446e1604e4f646d..d7bb83423ed70b8a8c8ee83e0cfb828fe97ae89f 100644
--- a/pkg/template_binding/lib/src/mustache_tokens.dart
+++ b/pkg/template_binding/lib/src/mustache_tokens.dart
@@ -112,9 +112,14 @@ class MustacheTokens {
var pathString = s.substring(startIndex + 2, endIndex).trim();
tokens.add(oneTime); // ONETIME?
onlyOneTime = onlyOneTime && oneTime;
- tokens.add(new PropertyPath(pathString)); // PATH
var delegateFn = delegate == null ? null :
delegate.prepareBinding(pathString, name, node);
+ // Don't try to parse the expression if there's a prepareBinding function
+ if (delegateFn == null) {
+ tokens.add(new PropertyPath(pathString)); // PATH
+ } else {
+ tokens.add(null); // PATH
+ }
tokens.add(delegateFn);
lastIndex = endIndex + 2;

Powered by Google App Engine
This is Rietveld 408576698