From bcb9fd28fb6274b910dce3bbbd16c93bb8663c48 Mon Sep 17 00:00:00 2001 From: Kallen Tu Date: Mon, 29 Aug 2022 18:53:15 +0000 Subject: [PATCH] Eliminate [] dynamic call in io_resource_info. Change-Id: I80a30d8c31ecc41f2ebf6f7fc8ac6dd41225ea4e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256600 Reviewed-by: Lasse Nielsen Reviewed-by: Leaf Petersen Commit-Queue: Kallen Tu --- pkg/compiler/test/analyses/api_allowed.json | 1 - sdk/lib/io/io_resource_info.dart | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/compiler/test/analyses/api_allowed.json b/pkg/compiler/test/analyses/api_allowed.json index 34db6851a65..500928cb372 100644 --- a/pkg/compiler/test/analyses/api_allowed.json +++ b/pkg/compiler/test/analyses/api_allowed.json @@ -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, diff --git a/sdk/lib/io/io_resource_info.dart b/sdk/lib/io/io_resource_info.dart index 3ba76c965ae..0954a559416 100644 --- a/sdk/lib/io/io_resource_info.dart +++ b/sdk/lib/io/io_resource_info.dart @@ -112,7 +112,8 @@ class _FileResourceInfo extends _ReadWriteResourceInfo { )); } - static Future getOpenFiles(function, params) { + static Future getOpenFiles( + String function, Map params) { assert(function == 'ext.dart.io.getOpenFiles'); final data = { 'type': 'OpenFileList', @@ -125,7 +126,7 @@ class _FileResourceInfo extends _ReadWriteResourceInfo { Map get fileInfoMap => fullValueMap; static Future getOpenFileInfoMapByID( - function, params) { + String function, Map params) { final id = int.parse(params['id']!); final result = openFiles.containsKey(id) ? openFiles[id]!.fileInfoMap : {}; final jsonValue = json.encode(result);