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

Unified Diff: pkg/analysis_server/lib/src/protocol.dart

Issue 300643002: Use type annotations everywhere in analysis_server/lib. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_manager.dart ('k') | pkg/analysis_server/lib/src/socket_server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/protocol.dart
diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart
index 75b29c7a60be4825563fd3b48fe0d764e371049a..50ace6ed2ed66512eb07cd209fa4d6a1a18a81a7 100644
--- a/pkg/analysis_server/lib/src/protocol.dart
+++ b/pkg/analysis_server/lib/src/protocol.dart
@@ -69,16 +69,16 @@ class Request {
*/
factory Request.fromString(String data) {
try {
- var result = DECODER.convert(data);
+ dynamic result = DECODER.convert(data);
Brian Wilkerson 2014/05/24 17:36:52 Hm. It might be better to leave 'var' in places wh
scheglov 2014/05/24 17:45:50 I rolled back places where we use "dynamic" type.
if (result is! Map) {
return null;
}
- var id = result[Request.ID];
- var method = result[Request.METHOD];
+ dynamic id = result[Request.ID];
+ dynamic method = result[Request.METHOD];
if (id is! String || method is! String) {
return null;
}
- var params = result[Request.PARAMS];
+ dynamic params = result[Request.PARAMS];
Request request = new Request(id, method);
if (params is Map) {
params.forEach((String key, Object value) {
@@ -263,7 +263,7 @@ class RequestDatum {
if (datum is! List) {
return false;
}
- for (var element in datum) {
+ for (dynamic element in datum) {
if (element is! String) {
return false;
}
@@ -292,7 +292,7 @@ class RequestDatum {
if (datum is! Map) {
return false;
}
- for (var value in datum.values) {
+ for (dynamic value in datum.values) {
if (value is! String) {
return false;
}
@@ -412,12 +412,12 @@ class Response {
*/
factory Response.fromJson(Map<String, Object> json) {
try {
- var id = json[Response.ID];
+ Object id = json[Response.ID];
if (id is! String) {
return null;
}
- var error = json[Response.ERROR];
- var result = json[Response.RESULT];
+ Object error = json[Response.ERROR];
+ Object result = json[Response.RESULT];
Response response;
if (error is Map) {
response = new Response(id, new RequestError.fromJson(error));
@@ -674,7 +674,7 @@ class Notification {
factory Notification.fromJson(Map<String, Object> json) {
try {
String event = json[Notification.EVENT];
- var params = json[Notification.PARAMS];
+ Object params = json[Notification.PARAMS];
Notification notification = new Notification(event);
if (params is Map) {
params.forEach((String key, Object value) {
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_manager.dart ('k') | pkg/analysis_server/lib/src/socket_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698