OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of dart2js; | 5 part of dart2js; |
6 | 6 |
7 /** | 7 /** |
8 * If true, print a warning for each method that was resolved, but not | 8 * If true, print a warning for each method that was resolved, but not |
9 * compiled. | 9 * compiled. |
10 */ | 10 */ |
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 * Get an [Uri] pointing to a patch for the dart: library with | 966 * Get an [Uri] pointing to a patch for the dart: library with |
967 * the given path. Returns null if there is no patch. | 967 * the given path. Returns null if there is no patch. |
968 */ | 968 */ |
969 Uri resolvePatchUri(String dartLibraryPath); | 969 Uri resolvePatchUri(String dartLibraryPath); |
970 | 970 |
971 Future runCompiler(Uri uri) { | 971 Future runCompiler(Uri uri) { |
972 // TODO(ahe): This prevents memory leaks when invoking the compiler | 972 // TODO(ahe): This prevents memory leaks when invoking the compiler |
973 // multiple times. Implement a better mechanism where we can store | 973 // multiple times. Implement a better mechanism where we can store |
974 // such caches in the compiler and get access to them through a | 974 // such caches in the compiler and get access to them through a |
975 // suitably maintained static reference to the current compiler. | 975 // suitably maintained static reference to the current compiler. |
976 SourceString.canonicalizedValues.clear(); | 976 StringToken.canonicalizedSubstrings.clear(); |
977 Selector.canonicalizedValues.clear(); | 977 Selector.canonicalizedValues.clear(); |
978 TypedSelector.canonicalizedValues.clear(); | 978 TypedSelector.canonicalizedValues.clear(); |
979 | 979 |
980 assert(uri != null || analyzeOnly); | 980 assert(uri != null || analyzeOnly); |
981 return scanBuiltinLibraries().then((_) { | 981 return scanBuiltinLibraries().then((_) { |
982 if (librariesToAnalyzeWhenRun != null) { | 982 if (librariesToAnalyzeWhenRun != null) { |
983 return Future.forEach(librariesToAnalyzeWhenRun, (libraryUri) { | 983 return Future.forEach(librariesToAnalyzeWhenRun, (libraryUri) { |
984 log('analyzing $libraryUri ($buildId)'); | 984 log('analyzing $libraryUri ($buildId)'); |
985 return libraryLoader.loadLibrary(libraryUri, null, libraryUri); | 985 return libraryLoader.loadLibrary(libraryUri, null, libraryUri); |
986 }); | 986 }); |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 message = message(); | 1581 message = message(); |
1582 } | 1582 } |
1583 throw new SpannableAssertionFailure(spannable, message); | 1583 throw new SpannableAssertionFailure(spannable, message); |
1584 } | 1584 } |
1585 return true; | 1585 return true; |
1586 } | 1586 } |
1587 | 1587 |
1588 /** | 1588 /** |
1589 * Global | 1589 * Global |
1590 */ | 1590 */ |
1591 bool isPrivateName(String s)=> !s.isEmpty && s.codeUnitAt(0) == $_; | 1591 bool isPrivateName(String s) => !s.isEmpty && s.codeUnitAt(0) == $_; |
1592 | 1592 |
1593 /// A sink that drains into /dev/null. | 1593 /// A sink that drains into /dev/null. |
1594 class NullSink implements EventSink<String> { | 1594 class NullSink implements EventSink<String> { |
1595 final String name; | 1595 final String name; |
1596 | 1596 |
1597 NullSink(this.name); | 1597 NullSink(this.name); |
1598 | 1598 |
1599 add(String value) {} | 1599 add(String value) {} |
1600 | 1600 |
1601 void addError(Object error, [StackTrace stackTrace]) {} | 1601 void addError(Object error, [StackTrace stackTrace]) {} |
1602 | 1602 |
1603 void close() {} | 1603 void close() {} |
1604 | 1604 |
1605 toString() => name; | 1605 toString() => name; |
1606 | 1606 |
1607 /// Convenience method for getting an [api.CompilerOutputProvider]. | 1607 /// Convenience method for getting an [api.CompilerOutputProvider]. |
1608 static NullSink outputProvider(String name, String extension) { | 1608 static NullSink outputProvider(String name, String extension) { |
1609 return new NullSink('$name.$extension'); | 1609 return new NullSink('$name.$extension'); |
1610 } | 1610 } |
1611 } | 1611 } |
OLD | NEW |