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

Side by Side Diff: lib/src/codegen/code_generator.dart

Issue 1245013002: some fixes for --strong warnings (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library dev_compiler.src.codegen.code_generator; 5 library dev_compiler.src.codegen.code_generator;
6 6
7 import 'package:analyzer/src/generated/element.dart' 7 import 'package:analyzer/src/generated/element.dart'
8 show CompilationUnitElement, LibraryElement; 8 show CompilationUnitElement, LibraryElement;
9 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; 9 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 list.add(_dirToPrefix(path.current)); 44 list.add(_dirToPrefix(path.current));
45 // Sort by reverse length to prefer longer prefixes. 45 // Sort by reverse length to prefer longer prefixes.
46 // This ensures that we get the minimum valid suffix. E.g., if we have: 46 // This ensures that we get the minimum valid suffix. E.g., if we have:
47 // - root/ 47 // - root/
48 // - root/generated/ 48 // - root/generated/
49 // in our search path, and the path "root/generated/foo/bar.dart", we'll 49 // in our search path, and the path "root/generated/foo/bar.dart", we'll
50 // compute "foo/bar.dart" instead of "generated/foo/bar.dart" in the search 50 // compute "foo/bar.dart" instead of "generated/foo/bar.dart" in the search
51 // below. 51 // below.
52 list.sort((s1, s2) => s2.length - s1.length); 52 list.sort((s1, s2) => s2.length - s1.length);
53 return list; 53 return list;
54 }(); 54 }() as List<String>;
Leaf 2015/07/22 22:29:15 This shouldn't be necessary, but currently is. I
55 55
56 static String _dirToPrefix(String dir) { 56 static String _dirToPrefix(String dir) {
57 dir = path.absolute(dir); 57 dir = path.absolute(dir);
58 dir = path.normalize(dir); 58 dir = path.normalize(dir);
59 if (!dir.endsWith(path.separator)) { 59 if (!dir.endsWith(path.separator)) {
60 dir = dir + path.separator; 60 dir = dir + path.separator;
61 } 61 }
62 return dir; 62 return dir;
63 } 63 }
64 64
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // Not a package. 120 // Not a package.
121 // TODO(leafp) These may need to be adjusted 121 // TODO(leafp) These may need to be adjusted
122 // relative to the import location 122 // relative to the import location
123 return new Uri(path: suffix); 123 return new Uri(path: suffix);
124 } 124 }
125 assert(index == 0); 125 assert(index == 0);
126 return new Uri( 126 return new Uri(
127 scheme: 'package', path: path.joinAll(parts.sublist(index + 1))); 127 scheme: 'package', path: path.joinAll(parts.sublist(index + 1)));
128 } 128 }
129 } 129 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698