Index: pkg/compiler/lib/src/compiler.dart |
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart |
index cd983fe414f486fc6b376cbc1186bc2e6eae2b71..392b2026b6fc8cbf6e8d66de3db1a9ca40e7f80d 100644 |
--- a/pkg/compiler/lib/src/compiler.dart |
+++ b/pkg/compiler/lib/src/compiler.dart |
@@ -84,6 +84,8 @@ import 'library_loader.dart' show |
LoadedLibraries; |
import 'mirrors_used.dart' show |
MirrorUsageAnalyzerTask; |
+import 'common/names.dart' show |
+ Selectors; |
import 'null_compiler_output.dart' show |
NullCompilerOutput, |
NullSink; |
@@ -842,6 +844,13 @@ abstract class Compiler { |
StringToken.canonicalizedSubstrings.clear(); |
Selector.canonicalizedValues.clear(); |
+ // The selector objects held in static fields must remain canonical. |
+ for (Selector selector in Selectors.ALL) { |
+ Selector.canonicalizedValues |
+ .putIfAbsent(selector.hashCode, () => <Selector>[]) |
+ .add(selector); |
+ } |
+ |
assert(uri != null || analyzeOnly || hasIncrementalSupport); |
return new Future.sync(() { |
if (librariesToAnalyzeWhenRun != null) { |
@@ -2065,4 +2074,4 @@ class GlobalDependencyRegistry extends EagerRegistry { |
Iterable<Element> get otherDependencies { |
return _otherDependencies != null ? _otherDependencies : const <Element>[]; |
} |
-} |
+} |