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

Unified Diff: tests/compiler/dart2js/serialization_helper.dart

Issue 1939703002: Don't crash on deserialized type inference. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments + minor fix. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/serialization_helper.dart
diff --git a/tests/compiler/dart2js/serialization_helper.dart b/tests/compiler/dart2js/serialization_helper.dart
index 2d1ea1fd6884e5d963d9f8e9cd770b0ee9962878..d3dc3dec198acf9804cab6934ca397d2893d8b40 100644
--- a/tests/compiler/dart2js/serialization_helper.dart
+++ b/tests/compiler/dart2js/serialization_helper.dart
@@ -211,7 +211,7 @@ class _DeserializerSystem extends DeserializerSystem {
}
@override
- bool hasResolvedAst(Element element) {
+ bool hasResolvedAst(ExecutableElement element) {
if (_resolvedAstDeserializer != null) {
return _resolvedAstDeserializer.hasResolvedAst(element);
}
@@ -219,7 +219,7 @@ class _DeserializerSystem extends DeserializerSystem {
}
@override
- ResolvedAst getResolvedAst(Element element) {
+ ResolvedAst getResolvedAst(ExecutableElement element) {
if (_resolvedAstDeserializer != null) {
return _resolvedAstDeserializer.getResolvedAst(element);
}
@@ -300,27 +300,30 @@ class ResolvedAstDeserializerPlugin extends DeserializerPlugin {
final Backend backend;
final Map<Uri, SourceFile> sourceFiles = <Uri, SourceFile>{};
- Map<Element, ResolvedAst> _resolvedAstMap = <Element, ResolvedAst>{};
- Map<Element, ObjectDecoder> _decoderMap = <Element, ObjectDecoder>{};
+ Map<ExecutableElement, ResolvedAst> _resolvedAstMap =
+ <ExecutableElement, ResolvedAst>{};
+ Map<MemberElement, ObjectDecoder> _decoderMap =
+ <MemberElement, ObjectDecoder>{};
Map<Uri, Token> beginTokenMap = <Uri, Token>{};
ResolvedAstDeserializerPlugin(this.parsingContext, this.backend);
- bool hasResolvedAst(Element element) {
+ bool hasResolvedAst(ExecutableElement element) {
return _resolvedAstMap.containsKey(element) ||
- _decoderMap.containsKey(element);
+ _decoderMap.containsKey(element.memberContext);
}
- ResolvedAst getResolvedAst(Element element) {
+ ResolvedAst getResolvedAst(ExecutableElement element) {
ResolvedAst resolvedAst = _resolvedAstMap[element];
if (resolvedAst == null) {
- ObjectDecoder decoder = _decoderMap[element];
+ ObjectDecoder decoder = _decoderMap[element.memberContext];
if (decoder != null) {
- resolvedAst = _resolvedAstMap[element] =
- ResolvedAstDeserializer.deserialize(
- element, decoder, parsingContext, findToken,
- backend.serialization.deserializer);
+ ResolvedAstDeserializer.deserialize(
+ element.memberContext, decoder, parsingContext, findToken,
+ backend.serialization.deserializer,
+ _resolvedAstMap);
_decoderMap.remove(element);
+ resolvedAst = _resolvedAstMap[element];
}
}
return resolvedAst;

Powered by Google App Engine
This is Rietveld 408576698