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

Unified Diff: pkg/analysis_server/tool/spec/api.dart

Issue 451483005: Code generate integration test methods for synchronous request/response pairs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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: pkg/analysis_server/tool/spec/api.dart
diff --git a/pkg/analysis_server/tool/spec/api.dart b/pkg/analysis_server/tool/spec/api.dart
index 489e7302c4277c2f48710bdf80685f458c5ded20..5b70f1449015a9cb5b55ef7ab961454bd333842d 100644
--- a/pkg/analysis_server/tool/spec/api.dart
+++ b/pkg/analysis_server/tool/spec/api.dart
@@ -119,17 +119,15 @@ class HierarchicalApiVisitor extends ApiVisitor {
}
/**
- * If [type] is a [TypeReference] which points to another [TypeReference],
- * follow the chain until the last [TypeReference] is reached.
+ * If [type] is a [TypeReference] that is defined in the API, follow the
+ * chain until a non-[TypeReference] is found, if possible.
+ *
+ * If it is not possible (because the chain ends with a [TypeReference] that
+ * is not defined in the API), then that final [TypeReference] is returned.
*/
- TypeReference resolveTypeReferenceChain(TypeReference type) {
- while (api.types.containsKey(type.typeName)) {
- TypeDecl referredType = api.types[type.typeName].type;
- if (referredType is TypeReference) {
- type = referredType;
- continue;
- }
- break;
+ TypeDecl resolveTypeReferenceChain(TypeDecl type) {
+ while (type is TypeReference && api.types.containsKey(type.typeName)) {
+ type = api.types[(type as TypeReference).typeName].type;
}
return type;
}

Powered by Google App Engine
This is Rietveld 408576698