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

Unified Diff: lib/src/analyzer.dart

Issue 19497002: Reducing the amount of code we generate in the compiler: We still continue (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
Patch Set: Created 7 years, 5 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: lib/src/analyzer.dart
diff --git a/lib/src/analyzer.dart b/lib/src/analyzer.dart
index 5948beef1dbdf0e8c979c36d0ca69f8b8e485f63..49f4826b06fa93adcda58db921cb59371dbd6349 100644
--- a/lib/src/analyzer.dart
+++ b/lib/src/analyzer.dart
@@ -110,7 +110,7 @@ class _Analyzer extends TreeVisitor {
node = _bindAndReplaceElement(node);
var lastInfo = _currentInfo;
- if (node.tagName == 'element') {
+ if (node.tagName == 'polymer-element') {
// If element is invalid _ElementLoader already reported an error, but
// we skip the body of the element here.
var name = node.attributes['name'];
@@ -119,9 +119,6 @@ class _Analyzer extends TreeVisitor {
ComponentInfo component = _fileInfo.components[name];
if (component == null) return;
- // Associate <element> tag with its component.
- component.elementNode = node;
-
_analyzeComponent(component);
_currentInfo = component;
@@ -210,7 +207,8 @@ class _Analyzer extends TreeVisitor {
} else if (isCustomTag(node.tagName)) {
componentName = node.tagName;
}
- if (component == null && componentName != null) {
+ if (component == null && componentName != null &&
+ componentName != 'polymer-element') {
_messages.warning(
'custom element with tag name $componentName not found.',
node.sourceSpan);
@@ -372,7 +370,13 @@ class _ElementLoader extends TreeVisitor {
void visitElement(Element node) {
switch (node.tagName) {
case 'link': visitLinkElement(node); break;
- case 'element': visitElementElement(node); break;
+ case 'element':
+ _messages.warning('<element> elements are not supported, use'
+ ' <polymer-element> instead', node.sourceSpan);
+ break;
+ case 'polymer-element':
+ visitElementElement(node);
+ break;
case 'script': visitScriptElement(node); break;
case 'head':
var savedInHead = _inHead;
« lib/polymer_element.dart ('K') | « lib/scoped_css.dart ('k') | lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698