Unverified Commit 31175eb0 authored by Dan Field's avatar Dan Field Committed by GitHub

Revert "Revert "Replace uses of deprecated CastError with TypeError (#53221)" (#53226)" (#53269)

parent 9ccac005
...@@ -70,7 +70,7 @@ void main() { ...@@ -70,7 +70,7 @@ void main() {
} }
}, },
); );
expect(channel.invokeMethod<List<String>>('sayHello', 'hello'), throwsA(isCastError)); expect(channel.invokeMethod<List<String>>('sayHello', 'hello'), throwsA(isInstanceOf<TypeError>()));
expect(await channel.invokeListMethod<String>('sayHello', 'hello'), <String>['hello', 'world']); expect(await channel.invokeListMethod<String>('sayHello', 'hello'), <String>['hello', 'world']);
}); });
...@@ -102,7 +102,7 @@ void main() { ...@@ -102,7 +102,7 @@ void main() {
} }
}, },
); );
expect(channel.invokeMethod<Map<String, String>>('sayHello', 'hello'), throwsA(isCastError)); expect(channel.invokeMethod<Map<String, String>>('sayHello', 'hello'), throwsA(isInstanceOf<TypeError>()));
expect(await channel.invokeMapMethod<String, String>('sayHello', 'hello'), <String, String>{'hello': 'world'}); expect(await channel.invokeMapMethod<String, String>('sayHello', 'hello'), <String, String>{'hello': 'world'});
}); });
......
...@@ -25,7 +25,7 @@ const bool kIconTreeShakerEnabledDefault = false; ...@@ -25,7 +25,7 @@ const bool kIconTreeShakerEnabledDefault = false;
List<Map<String, dynamic>> _getList(dynamic object, String errorMessage) { List<Map<String, dynamic>> _getList(dynamic object, String errorMessage) {
try { try {
return (object as List<dynamic>).cast<Map<String, dynamic>>(); return (object as List<dynamic>).cast<Map<String, dynamic>>();
} on CastError catch (_) { } on TypeError catch (_) {
throw IconTreeShakerException._(errorMessage); throw IconTreeShakerException._(errorMessage);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment