Eliminate [] dynamic call in io_resource_info.
Change-Id: I80a30d8c31ecc41f2ebf6f7fc8ac6dd41225ea4e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256600 Reviewed-by: Lasse Nielsen <lrn@google.com> Reviewed-by: Leaf Petersen <leafp@google.com> Commit-Queue: Kallen Tu <kallentu@google.com>
This commit is contained in:
@@ -52,7 +52,6 @@
|
||||
"Dynamic invocation of '[]'.": 7
|
||||
},
|
||||
"org-dartlang-sdk:///lib/io/io_resource_info.dart": {
|
||||
"Dynamic invocation of '[]'.": 1,
|
||||
"Dynamic access of 'path'.": 1,
|
||||
"Dynamic access of 'dart.io::_path'.": 1,
|
||||
"Dynamic access of 'pid'.": 1,
|
||||
|
||||
@@ -112,7 +112,8 @@ class _FileResourceInfo extends _ReadWriteResourceInfo {
|
||||
));
|
||||
}
|
||||
|
||||
static Future<ServiceExtensionResponse> getOpenFiles(function, params) {
|
||||
static Future<ServiceExtensionResponse> getOpenFiles(
|
||||
String function, Map<String, String> params) {
|
||||
assert(function == 'ext.dart.io.getOpenFiles');
|
||||
final data = {
|
||||
'type': 'OpenFileList',
|
||||
@@ -125,7 +126,7 @@ class _FileResourceInfo extends _ReadWriteResourceInfo {
|
||||
Map<String, dynamic> get fileInfoMap => fullValueMap;
|
||||
|
||||
static Future<ServiceExtensionResponse> getOpenFileInfoMapByID(
|
||||
function, params) {
|
||||
String function, Map<String, String> params) {
|
||||
final id = int.parse(params['id']!);
|
||||
final result = openFiles.containsKey(id) ? openFiles[id]!.fileInfoMap : {};
|
||||
final jsonValue = json.encode(result);
|
||||
|
||||
Reference in New Issue
Block a user