Chromium Code Reviews| 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 /// Logic to validate that developers are correctly using Polymer constructs. | 5 /// Logic to validate that developers are correctly using Polymer constructs. |
| 6 /// This is mainly used to produce warnings for feedback in the editor. | 6 /// This is mainly used to produce warnings for feedback in the editor. |
| 7 library polymer.src.build.linter; | 7 library polymer.src.build.linter; |
| 8 | 8 |
| 9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 | 10 |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 if (isCustomTagName(nodeTag)) { | 331 if (isCustomTagName(nodeTag)) { |
| 332 // <fancy-button> | 332 // <fancy-button> |
| 333 customTagName = nodeTag; | 333 customTagName = nodeTag; |
| 334 hasIsAttribute = false; | 334 hasIsAttribute = false; |
| 335 } else { | 335 } else { |
| 336 // <button is="fancy-button"> | 336 // <button is="fancy-button"> |
| 337 customTagName = node.attributes['is']; | 337 customTagName = node.attributes['is']; |
| 338 hasIsAttribute = true; | 338 hasIsAttribute = true; |
| 339 } | 339 } |
| 340 | 340 |
| 341 if (customTagName == null || customTagName == 'polymer-element') return; | 341 if (customTagName == null || customTagName == 'polymer-element' || |
|
Siggi Cherem (dart-lang)
2014/07/07 21:11:26
let's put polymer-element also as part of the list
| |
| 342 | 342 INTERNALLY_DEFINED_ELEMENTS.contains(customTagName)) { |
| 343 return; | |
| 344 } | |
| 345 | |
| 343 var info = _elements[customTagName]; | 346 var info = _elements[customTagName]; |
| 344 if (info == null) { | 347 if (info == null) { |
| 345 // TODO(jmesserly): this warning is wrong if someone is using raw custom | 348 // TODO(jmesserly): this warning is wrong if someone is using raw custom |
| 346 // elements. Is there another way we can handle this warning that won't | 349 // elements. Is there another way we can handle this warning that won't |
| 347 // generate false positives? | 350 // generate false positives? |
| 348 _logger.warning('definition for Polymer element with tag name ' | 351 _logger.warning('definition for Polymer element with tag name ' |
| 349 '"$customTagName" not found.', span: node.sourceSpan); | 352 '"$customTagName" not found.', span: node.sourceSpan); |
| 350 return; | 353 return; |
| 351 } | 354 } |
| 352 | 355 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 444 const String USE_INIT_DART = | 447 const String USE_INIT_DART = |
| 445 'To run a polymer application, you need to call "initPolymer". You can ' | 448 'To run a polymer application, you need to call "initPolymer". You can ' |
| 446 'either include a generic script tag that does this for you:' | 449 'either include a generic script tag that does this for you:' |
| 447 '\'<script type="application/dart">export "package:polymer/init.dart";' | 450 '\'<script type="application/dart">export "package:polymer/init.dart";' |
| 448 '</script>\' or add your own script tag and call that function. ' | 451 '</script>\' or add your own script tag and call that function. ' |
| 449 'Make sure the script tag is placed after all HTML imports.'; | 452 'Make sure the script tag is placed after all HTML imports.'; |
| 450 | 453 |
| 451 const String NO_DART_SCRIPT_AND_EXPERIMENTAL = | 454 const String NO_DART_SCRIPT_AND_EXPERIMENTAL = |
| 452 'The experimental bootstrap feature doesn\'t support script tags on ' | 455 'The experimental bootstrap feature doesn\'t support script tags on ' |
| 453 'the main document (for now).'; | 456 'the main document (for now).'; |
| 457 | |
| 458 const List<String> INTERNALLY_DEFINED_ELEMENTS = const ['auto-binding-dart']; | |
| OLD | NEW |