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

Unified Diff: pkg/polymer/test/build/script_compactor_test.dart

Issue 303003003: Fix 19029: handle special case when on-handler is empty in polymer, add better (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 | « pkg/polymer/test/build/linter_test.dart ('k') | pkg/smoke/lib/codegen/generator.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/test/build/script_compactor_test.dart
diff --git a/pkg/polymer/test/build/script_compactor_test.dart b/pkg/polymer/test/build/script_compactor_test.dart
index a2dc1c672ae43be40adcb1acdba54d166e3aaba7..7b57ed8998c3ed43a894c26e39e54b61334d7be9 100644
--- a/pkg/polymer/test/build/script_compactor_test.dart
+++ b/pkg/polymer/test/build/script_compactor_test.dart
@@ -653,18 +653,24 @@ codegenTests(phases) {
'<!DOCTYPE html><html><body>'
'<polymer-element name="foo-bar"><template>'
'<div>{{a.node}}</div>'
- '<div>{{anotherNode}}</div>'
+ '<div>{{ anotherNode }}</div>' // extra space inside bindings is OK
'<div>{{a.call1(a)}}</div>'
'<div>{{call2(a)}}</div>'
+ '<div>{{}}</div>' // empty bindings are ignored
+ '<div>{{ }}</div>'
'<div class="{{an.attribute}}"></div>'
'<a href="path/{{within.an.attribute}}/foo/bar"></a>'
'<div data-attribute="{{anotherAttribute}}"></div>'
// input and custom-element attributes are treated as 2-way bindings:
- '<input value="{{this.is.twoWay}}">'
- '<input value="{{this.is.twoWayInt | intToStringTransformer}}">'
+ '<input value="{{this.iS.twoWay}}">'
+ '<input value="{{this.iS.twoWayInt | intToStringTransformer}}">'
'<something-else my-attribute="{{here.too}}"></something-else>'
'<div on-click="{{methodName}}"></div>'
+ '<div on-click="{{ methodName2 }}"></div>' // extra space is OK
'<div on-click="{{@read.method}}"></div>'
+ // empty handlers are invalid, but we still produce valid output.
+ '<div on-click="{{}}"></div>'
+ '<div on-click="{{ }}"></div>'
'</template></polymer-element>',
'a|web/test.html._data': expectedData(['web/a.dart']),
'a|web/a.dart':
@@ -689,10 +695,11 @@ codegenTests(phases) {
#call1: (o) => o.call1,
#call2: (o) => o.call2,
#here: (o) => o.here,
+ #iS: (o) => o.iS,
#intToStringTransformer: (o) => o.intToStringTransformer,
- #is: (o) => o.is,
#method: (o) => o.method,
#methodName: (o) => o.methodName,
+ #methodName2: (o) => o.methodName2,
#node: (o) => o.node,
#read: (o) => o.read,
#too: (o) => o.too,
@@ -714,10 +721,11 @@ codegenTests(phases) {
#call1: r'call1',
#call2: r'call2',
#here: r'here',
+ #iS: r'iS',
#intToStringTransformer: r'intToStringTransformer',
- #is: r'is',
#method: r'method',
#methodName: r'methodName',
+ #methodName2: r'methodName2',
#node: r'node',
#read: r'read',
#too: r'too',
« no previous file with comments | « pkg/polymer/test/build/linter_test.dart ('k') | pkg/smoke/lib/codegen/generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698