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

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

Issue 211393006: Enables codegen support in polymer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 df3331894f2c75ef5e23101a4813aaec30335ca3..9a7b8c5e269bbf04864fb069f65f2284c50d4f3a 100644
--- a/pkg/polymer/lib/src/build/linter.dart
+++ b/pkg/polymer/lib/src/build/linter.dart
@@ -214,14 +214,14 @@ class _LinterVisitor extends TreeVisitor {
_logger.error('Missing tag name of the custom element. Please include an '
'attribute like \'name="your-tag-name"\'.',
span: node.sourceSpan);
- } else if (!_isCustomTag(tagName)) {
+ } else if (!isCustomTagName(tagName)) {
_logger.error('Invalid name "$tagName". Custom element names must have '
'at least one dash and can\'t be any of the following names: '
- '${_invalidTagNames.keys.join(", ")}.',
+ '${invalidTagNames.keys.join(", ")}.',
span: node.sourceSpan);
}
- if (_elements[extendsTag] == null && _isCustomTag(extendsTag)) {
+ if (_elements[extendsTag] == null && isCustomTagName(extendsTag)) {
_logger.warning('custom element with name "$extendsTag" not found.',
span: node.sourceSpan);
}
@@ -299,7 +299,7 @@ class _LinterVisitor extends TreeVisitor {
var nodeTag = node.localName;
var hasIsAttribute;
var customTagName;
- if (_isCustomTag(nodeTag)) {
+ if (isCustomTagName(nodeTag)) {
// <fancy-button>
customTagName = nodeTag;
hasIsAttribute = false;
@@ -387,27 +387,6 @@ class _LinterVisitor extends TreeVisitor {
}
}
-
-// These names have meaning in SVG or MathML, so they aren't allowed as custom
-// tags.
-var _invalidTagNames = const {
- 'annotation-xml': '',
- 'color-profile': '',
- 'font-face': '',
- 'font-face-src': '',
- 'font-face-uri': '',
- 'font-face-format': '',
- 'font-face-name': '',
- 'missing-glyph': '',
-};
-
-/// Returns true if this is a valid custom element name. See:
-/// <https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html#dfn-custom-element-name>
-bool _isCustomTag(String name) {
- if (name == null || !name.contains('-')) return false;
- return !_invalidTagNames.containsKey(name);
-}
-
const String USE_INIT_DART =
'To run a polymer application, you need to call "initPolymer". You can '
'either include a generic script tag that does this for you:'

Powered by Google App Engine
This is Rietveld 408576698