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

Unified Diff: pkg/analysis_server/benchmark/integration/input_converter.dart

Issue 1855643002: More strong mode changes to analysis_server (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Backout changes to options file Created 4 years, 9 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 | « no previous file | pkg/analysis_server/benchmark/integration/instrumentation_input_converter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/benchmark/integration/input_converter.dart
diff --git a/pkg/analysis_server/benchmark/integration/input_converter.dart b/pkg/analysis_server/benchmark/integration/input_converter.dart
index 2e941ffde16ad1e185c7ea9db80f243905c735f0..f61984515be36e7a4f2239e5e466bd9be82b584c 100644
--- a/pkg/analysis_server/benchmark/integration/input_converter.dart
+++ b/pkg/analysis_server/benchmark/integration/input_converter.dart
@@ -72,6 +72,8 @@ abstract class CommonInputConverter extends Converter<String, Operation> {
CommonInputConverter(this.tmpSrcDirPath, this.srcPathMap);
+ Map<String, dynamic> asMap(dynamic value) => value as Map<String, dynamic>;
+
/**
* Return an operation for the notification or `null` if none.
*/
@@ -79,9 +81,9 @@ abstract class CommonInputConverter extends Converter<String, Operation> {
String event = json['event'];
if (event == SERVER_STATUS) {
// {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
- Map<String, dynamic> params = json['params'];
+ Map<String, dynamic> params = asMap(json['params']);
if (params != null) {
- Map<String, dynamic> analysis = params['analysis'];
+ Map<String, dynamic> analysis = asMap(params['analysis']);
if (analysis != null && analysis['isAnalyzing'] == false) {
return new WaitForAnalysisCompleteOperation();
}
@@ -101,7 +103,7 @@ abstract class CommonInputConverter extends Converter<String, Operation> {
* Return an operation for the request or `null` if none.
*/
Operation convertRequest(Map<String, dynamic> origJson) {
- Map<String, dynamic> json = translateSrcPaths(origJson);
+ Map<String, dynamic> json = asMap(translateSrcPaths(origJson));
requestMap[json['id']] = json;
String method = json['method'];
// Sanity check operations that modify source
@@ -172,8 +174,8 @@ abstract class CommonInputConverter extends Converter<String, Operation> {
* Return an operation for the recorded/expected response.
*/
Operation convertResponse(Map<String, dynamic> json) {
- return new ResponseOperation(
- this, requestMap.remove(json['id']), translateSrcPaths(json));
+ return new ResponseOperation(this, asMap(requestMap.remove(json['id'])),
+ asMap(translateSrcPaths(json)));
}
void logOverlayContent() {
« no previous file with comments | « no previous file | pkg/analysis_server/benchmark/integration/instrumentation_input_converter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698