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

Side by Side Diff: pkg/polymer/lib/src/build/linter.dart

Issue 783393005: fix logic for detecting when in an auto-binding element (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 6 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/polymer/CHANGELOG.md ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import 'dart:convert'; 10 import 'dart:convert';
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 } 188 }
189 189
190 void visitElement(Element node) { 190 void visitElement(Element node) {
191 switch (node.localName) { 191 switch (node.localName) {
192 case 'link': _validateLinkElement(node); break; 192 case 'link': _validateLinkElement(node); break;
193 case 'element': _validateElementElement(node); break; 193 case 'element': _validateElementElement(node); break;
194 case 'polymer-element': _validatePolymerElement(node); break; 194 case 'polymer-element': _validatePolymerElement(node); break;
195 case 'script': _validateScriptElement(node); break; 195 case 'script': _validateScriptElement(node); break;
196 case 'template': 196 case 'template':
197 var isTag = node.attributes['is']; 197 var isTag = node.attributes['is'];
198 var oldInAutoBindingElement = _inAutoBindingElement;
198 if (isTag != null && AUTO_BINDING_ELEMENTS.contains(isTag)) { 199 if (isTag != null && AUTO_BINDING_ELEMENTS.contains(isTag)) {
199 _inAutoBindingElement = true; 200 _inAutoBindingElement = true;
200 } 201 }
201 _validateNormalElement(node); 202 _validateNormalElement(node);
202 super.visitElement(node); 203 super.visitElement(node);
203 _inAutoBindingElement = false; 204 _inAutoBindingElement = oldInAutoBindingElement;
204 break; 205 break;
205 default: 206 default:
206 _validateNormalElement(node); 207 _validateNormalElement(node);
207 super.visitElement(node); 208 super.visitElement(node);
208 break; 209 break;
209 } 210 }
210 } 211 }
211 212
212 void run(Document doc) { 213 void run(Document doc) {
213 visit(doc); 214 visit(doc);
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 upDirCount = segments.length - 2; 461 upDirCount = segments.length - 2;
461 } 462 }
462 var reachOutPrefix = '../' * upDirCount; 463 var reachOutPrefix = '../' * upDirCount;
463 return USE_POLYMER_HTML.create({'reachOutPrefix': reachOutPrefix}); 464 return USE_POLYMER_HTML.create({'reachOutPrefix': reachOutPrefix});
464 } 465 }
465 466
466 const List<String> INTERNALLY_DEFINED_ELEMENTS = 467 const List<String> INTERNALLY_DEFINED_ELEMENTS =
467 const ['auto-binding-dart', 'polymer-element']; 468 const ['auto-binding-dart', 'polymer-element'];
468 const List<String> AUTO_BINDING_ELEMENTS = 469 const List<String> AUTO_BINDING_ELEMENTS =
469 const ['auto-binding-dart', 'auto-binding']; 470 const ['auto-binding-dart', 'auto-binding'];
OLDNEW
« no previous file with comments | « pkg/polymer/CHANGELOG.md ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698