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

Side by Side Diff: third_party/pkg/angular/lib/tools/source_crawler_impl.dart

Issue 256553002: Revert "Update all Angular libs (run update_all.sh)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 library angular.source_crawler_impl; 1 library angular.source_crawler_impl;
2 2
3 import 'dart:io'; 3 import 'dart:io';
4 import 'package:analyzer/analyzer.dart'; 4 import 'package:analyzer/analyzer.dart';
5 import 'package:angular/tools/source_crawler.dart'; 5 import 'package:angular/tools/source_crawler.dart';
6 6
7 const String PACKAGE_PREFIX = 'package:'; 7 const String PACKAGE_PREFIX = 'package:';
8 8
9 /** 9 /**
10 * Dart source file crawler. As it crawls Dart source, it calls 10 * Dart source file crawler. As it crawls Dart source, it calls
(...skipping 27 matching lines...) Expand all
38 CompilationUnit cu = parseDartFile(currentFile); 38 CompilationUnit cu = parseDartFile(currentFile);
39 processImports(cu, currentDir, currentFile, visited, toVisit); 39 processImports(cu, currentDir, currentFile, visited, toVisit);
40 visitor(cu); 40 visitor(cu);
41 } 41 }
42 } 42 }
43 43
44 void processImports(CompilationUnit cu, String currentDir, 44 void processImports(CompilationUnit cu, String currentDir,
45 String currentFile, List<String> visited, 45 String currentFile, List<String> visited,
46 List<String> toVisit) { 46 List<String> toVisit) {
47 cu.directives.forEach((Directive directive) { 47 cu.directives.forEach((Directive directive) {
48 if (directive is ImportDirective || 48 if (directive is ImportDirective || directive is PartDirective) {
49 directive is PartDirective ||
50 directive is ExportDirective) {
51 UriBasedDirective import = directive; 49 UriBasedDirective import = directive;
52 String canonicalFile = canonicalizeImportPath( 50 String canonicalFile = canonicalizeImportPath(
53 currentDir, currentFile, import.uri.stringValue); 51 currentDir, currentFile, import.uri.stringValue);
54 if (canonicalFile == null) return; 52 if (canonicalFile == null) return;
55 if (!visited.contains(canonicalFile) && 53 if (!visited.contains(canonicalFile) &&
56 !toVisit.contains(canonicalFile)) { 54 !toVisit.contains(canonicalFile)) {
57 toVisit.add(canonicalFile); 55 toVisit.add(canonicalFile);
58 } 56 }
59 } 57 }
60 }); 58 });
(...skipping 30 matching lines...) Expand all
91 } 89 }
92 90
93 String _packageUriResolver(String uri, String packageRoot) { 91 String _packageUriResolver(String uri, String packageRoot) {
94 var packagePath = uri.substring(PACKAGE_PREFIX.length); 92 var packagePath = uri.substring(PACKAGE_PREFIX.length);
95 if (!packageRoot.endsWith('/')) { 93 if (!packageRoot.endsWith('/')) {
96 packageRoot = packageRoot + '/'; 94 packageRoot = packageRoot + '/';
97 } 95 }
98 return packageRoot + packagePath; 96 return packageRoot + packagePath;
99 } 97 }
100 } 98 }
OLDNEW
« no previous file with comments | « third_party/pkg/angular/lib/tools/selector.dart ('k') | third_party/pkg/angular/lib/tools/source_metadata_extractor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698