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

Unified Diff: third_party/pkg/angular/lib/tools/html_extractor.dart

Issue 176943008: Update the Angular/DI tests to latest from github. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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: third_party/pkg/angular/lib/tools/html_extractor.dart
diff --git a/third_party/pkg/angular/lib/tools/html_extractor.dart b/third_party/pkg/angular/lib/tools/html_extractor.dart
index 175e74be62db8337bbde0e5d8f6f82a7f87849df..4dc637cb478eec4e0765932b4f30634e7597b4a7 100644
--- a/third_party/pkg/angular/lib/tools/html_extractor.dart
+++ b/third_party/pkg/angular/lib/tools/html_extractor.dart
@@ -14,27 +14,26 @@ RegExp _NG_REPEAT_SYNTAX = new RegExp(r'^\s*(.+)\s+in\s+(.*?)\s*(\s+track\s+by\s
class HtmlExpressionExtractor {
List<DirectiveInfo> directiveInfos;
- IoService ioService;
- HtmlExpressionExtractor(this.directiveInfos, this.ioService);
+ HtmlExpressionExtractor(this.directiveInfos) {
+ for (DirectiveInfo directiveInfo in directiveInfos) {
+ expressions.addAll(directiveInfo.expressions);
+ if (directiveInfo.template != null) {
+ parseHtml(directiveInfo.template);
+ }
+ }
+ }
Set<String> expressions = new Set<String>();
- void crawl(root) {
+ void crawl(String root, IoService ioService) {
ioService.visitFs(root, (String file) {
if (!file.endsWith('.html')) return;
-
- _parseHtml(ioService.readAsStringSync(file));
+ parseHtml(ioService.readAsStringSync(file));
});
- for (DirectiveInfo directiveInfo in directiveInfos) {
- expressions.addAll(directiveInfo.expressions);
- if (directiveInfo.template != null) {
- _parseHtml(directiveInfo.template);
- }
- }
}
- void _parseHtml(String html) {
+ void parseHtml(String html) {
var document = parse(html);
visitNodes([document], (Node node) {
if (matchesNode(node, r'[*=/{{.*}}/]')) {

Powered by Google App Engine
This is Rietveld 408576698