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

Unified Diff: pkg/polymer/lib/src/build/linter.dart

Issue 334003003: Reduce warnings in polymer: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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/lib/src/build/common.dart ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b43dba7aa86f1b6671fc15434a8defb1c78e1952..0543dab18f11988994d4705bb9ed14b31597786f 100644
--- a/pkg/polymer/lib/src/build/linter.dart
+++ b/pkg/polymer/lib/src/build/linter.dart
@@ -71,7 +71,7 @@ class Linter extends Transformer with PolymerTransformer {
Set<AssetId> seen, Map<String, _ElementSummary> elements) {
if (id == null || seen.contains(id)) return new Future.value(null);
seen.add(id);
- return readAsHtml(id, transform).then(
+ return readAsHtml(id, transform, showWarnings: false).then(
(doc) => _collectElements(doc, id, transform, seen, elements));
}
@@ -88,8 +88,8 @@ class Linter extends Transformer with PolymerTransformer {
importIds.add(assetExists(id, transform).then((exists) {
if (exists) return id;
if (sourceId == transform.primaryInput.id) {
- logger.error('couldn\'t find imported asset "${id.path}" in package '
- '"${id.package}".', span: span);
+ logger.warning('couldn\'t find imported asset "${id.path}" in package'
Siggi Cherem (dart-lang) 2014/06/14 02:24:57 no reason to make this an error (errors make the b
+ ' "${id.package}".', span: span);
}
}));
}
@@ -135,8 +135,11 @@ class _ElementSummary {
_ElementSummary extendsType;
bool hasConflict = false;
- String get baseExtendsTag => extendsType == null
- ? extendsTag : extendsType.baseExtendsTag;
+ String get baseExtendsTag {
+ if (extendsType != null) return extendsType.baseExtendsTag;
+ if (extendsTag != null && !extendsTag.contains('-')) return extendsTag;
Siggi Cherem (dart-lang) 2014/06/14 02:24:57 this compensates for allowing the warning above
+ return null;
+ }
_ElementSummary(this.tagName, this.extendsTag, this.span);
@@ -382,17 +385,7 @@ class _LinterVisitor extends TreeVisitor {
/// Validate event handlers are used correctly.
void _validateEventHandler(Element node, String name, String value) {
- if (!name.startsWith('on-')) {
- // TODO(sigmund): technically these are valid attribtues in HTML, so we
- // might want to remove this warning, or only produce it if the value
- // looks like a binding.
- _logger.warning('Event handler "$name" will be interpreted as an inline'
- ' JavaScript event handler. Use the form '
- '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;
- }
+ if (!name.startsWith('on-')) return;
if (!_inPolymerElement) {
_logger.warning('Inline event handlers are only supported inside '
« no previous file with comments | « pkg/polymer/lib/src/build/common.dart ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698