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

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

Issue 56933002: Version 0.8.10.1 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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 | « dart/pkg/polymer/test/nested_binding_test.html ('k') | dart/pkg/shadow_dom/lib/shadow_dom.debug.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/polymer_expressions/lib/polymer_expressions.dart
===================================================================
--- dart/pkg/polymer_expressions/lib/polymer_expressions.dart (revision 29785)
+++ dart/pkg/polymer_expressions/lib/polymer_expressions.dart (working copy)
@@ -70,6 +70,17 @@
prepareBinding(String path, name, node) {
if (path == null) return null;
var expr = new Parser(path).parse();
+
+ // For template bind/repeat to an empty path, just pass through the model.
+ // We don't want to unwrap the Scope.
+ // TODO(jmesserly): a custom element extending <template> could notice this
+ // behavior. An alternative is to associate the Scope with the node via an
+ // Expando, which is what the JavaScript PolymerExpressions does.
+ if (isSemanticTemplate(node) && (name == 'bind' || name == 'repeat') &&
+ expr is EmptyExpression) {
+ return null;
+ }
+
return (model, node) {
if (model is! Scope) {
model = new Scope(model: model, variables: globals);
« no previous file with comments | « dart/pkg/polymer/test/nested_binding_test.html ('k') | dart/pkg/shadow_dom/lib/shadow_dom.debug.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698