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

Unified Diff: pkg/polymer/lib/src/build/linter.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
Index: pkg/polymer/lib/src/build/linter.dart
diff --git a/pkg/polymer/lib/src/build/linter.dart b/pkg/polymer/lib/src/build/linter.dart
index c8e8a1854394ca67b2cefe1ec5380dd805a2b6b7..abf0529f45924ac62536529537b6c16dcc17d05c 100644
--- a/pkg/polymer/lib/src/build/linter.dart
+++ b/pkg/polymer/lib/src/build/linter.dart
@@ -369,7 +369,7 @@ class _LinterVisitor extends TreeVisitor {
if (!name.startsWith('on-')) {
_logger.warning('Event handler "$name" will be interpreted as an inline'
Jennifer Messerly 2014/05/29 00:27:42 hmmm. at some point we might consider loosening th
Siggi Cherem (dart-lang) 2014/05/29 01:04:21 yeah, good point. Added TODO for now.
' JavaScript event handler. Use the form '
- 'on-event-name="handlerName" if you want a Dart handler '
+ 'on-event-name="{{handlerName}}" if you want a Dart handler '
'that will automatically update the UI based on model changes.',
span: node.attributeSpans[name]);
return;
@@ -381,10 +381,10 @@ class _LinterVisitor extends TreeVisitor {
span: node.attributeSpans[name]);
}
- if (value.contains('(')) {
+ if (value == '' || value == "{{}}" || value.contains('(')) {
Jennifer Messerly 2014/05/29 00:27:42 hmmm, not sure about this one ... any reason to s
Siggi Cherem (dart-lang) 2014/05/29 01:04:21 Good point. Done.
_logger.warning('Invalid event handler body "$value". Declare a method '
'in your custom element "void handlerName(event, detail, target)" '
- 'and use the form $name="handlerName".',
+ 'and use the form $name="{{handlerName}}".',
Jennifer Messerly 2014/05/29 00:27:42 nice catch!
span: node.attributeSpans[name]);
}
}
« no previous file with comments | « no previous file | pkg/polymer/lib/src/build/script_compactor.dart » ('j') | pkg/polymer/lib/src/build/script_compactor.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698