OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Logic to validate that developers are correctly using Polymer constructs. | 6 * Logic to validate that developers are correctly using Polymer constructs. |
7 * This is mainly used to produce warnings for feedback in the editor. | 7 * This is mainly used to produce warnings for feedback in the editor. |
8 */ | 8 */ |
9 library polymer.src.build.linter; | 9 library polymer.src.build.linter; |
10 | 10 |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 span: node.attributeSpans[name]); | 407 span: node.attributeSpans[name]); |
408 return; | 408 return; |
409 } | 409 } |
410 | 410 |
411 if (!_inPolymerElement) { | 411 if (!_inPolymerElement) { |
412 _logger.warning('Inline event handlers are only supported inside ' | 412 _logger.warning('Inline event handlers are only supported inside ' |
413 'declarations of <polymer-element>.', | 413 'declarations of <polymer-element>.', |
414 span: node.attributeSpans[name]); | 414 span: node.attributeSpans[name]); |
415 } | 415 } |
416 | 416 |
417 if (value.contains('.') || value.contains('(')) { | 417 if (value.contains('(')) { |
418 _logger.warning('Invalid event handler body "$value". Declare a method ' | 418 _logger.warning('Invalid event handler body "$value". Declare a method ' |
419 'in your custom element "void handlerName(event, detail, target)" ' | 419 'in your custom element "void handlerName(event, detail, target)" ' |
420 'and use the form $name="handlerName".', | 420 'and use the form $name="handlerName".', |
421 span: node.attributeSpans[name]); | 421 span: node.attributeSpans[name]); |
422 } | 422 } |
423 } | 423 } |
424 } | 424 } |
425 | 425 |
426 | 426 |
427 // These names have meaning in SVG or MathML, so they aren't allowed as custom | 427 // These names have meaning in SVG or MathML, so they aren't allowed as custom |
(...skipping 26 matching lines...) Expand all Loading... |
454 'Make sure the script tag is placed after all HTML imports.'; | 454 'Make sure the script tag is placed after all HTML imports.'; |
455 | 455 |
456 const String BOOT_JS_DEPRECATED = | 456 const String BOOT_JS_DEPRECATED = |
457 '"boot.js" is now deprecated. Instead, you can initialize your polymer ' | 457 '"boot.js" is now deprecated. Instead, you can initialize your polymer ' |
458 'application by calling "initPolymer()" in your main. If you don\'t have a ' | 458 'application by calling "initPolymer()" in your main. If you don\'t have a ' |
459 'main, then you can include our generic main by adding the following ' | 459 'main, then you can include our generic main by adding the following ' |
460 'script tag to your page: \'<script type="application/dart">export ' | 460 'script tag to your page: \'<script type="application/dart">export ' |
461 '"package:polymer/init.dart";</script>\'. Additionally you need to ' | 461 '"package:polymer/init.dart";</script>\'. Additionally you need to ' |
462 'include: \'<script src="packages/browser/dart.js"></script>\' in the page ' | 462 'include: \'<script src="packages/browser/dart.js"></script>\' in the page ' |
463 'too. Make sure these script tags come after all HTML imports.'; | 463 'too. Make sure these script tags come after all HTML imports.'; |
OLD | NEW |