[frdb] Fix JSON casting in RPC calls. (#18655)
This prevents the error: `type 'List<dynamic>' is not a subtype of type 'List<Map<String, dynamic>>' ` The test added fails when dart_vm.dart is reverted to `master`, and succeeds in its current state. This issue was run into while connecting to the Dart VM.
This commit is contained in:
@@ -122,9 +122,8 @@ class DartVm {
|
||||
Future<List<IsolateRef>> getMainIsolatesByPattern(Pattern pattern) async {
|
||||
final Map<String, dynamic> jsonVmRef =
|
||||
await invokeRpc('getVM', timeout: _kRpcTimeout);
|
||||
final List<Map<String, dynamic>> jsonIsolates = jsonVmRef['isolates'];
|
||||
final List<IsolateRef> result = <IsolateRef>[];
|
||||
for (Map<String, dynamic> jsonIsolate in jsonIsolates) {
|
||||
for (Map<String, dynamic> jsonIsolate in jsonVmRef['isolates']) {
|
||||
final String name = jsonIsolate['name'];
|
||||
if (name.contains(pattern) && name.contains(new RegExp(r':main\(\)'))) {
|
||||
result.add(new IsolateRef._fromJson(jsonIsolate, this));
|
||||
@@ -164,8 +163,7 @@ class DartVm {
|
||||
final List<FlutterView> views = <FlutterView>[];
|
||||
final Map<String, dynamic> rpcResponse =
|
||||
await invokeRpc('_flutter.listViews', timeout: _kRpcTimeout);
|
||||
final List<Map<String, dynamic>> flutterViewsJson = rpcResponse['views'];
|
||||
for (Map<String, dynamic> jsonView in flutterViewsJson) {
|
||||
for (Map<String, dynamic> jsonView in rpcResponse['views']) {
|
||||
final FlutterView flutterView = new FlutterView._fromJson(jsonView);
|
||||
if (flutterView != null) {
|
||||
views.add(flutterView);
|
||||
|
||||
Reference in New Issue
Block a user