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

Unified Diff: tools/testing/dart/vendored_pkg/args/args.dart

Issue 2903703002: Tighten types in test.dart even more. (Closed)
Patch Set: Play nicer with strong mode. Created 3 years, 7 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 | « tools/testing/dart/utils.dart ('k') | tools/testing/dart/vendored_pkg/args/src/parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/vendored_pkg/args/args.dart
diff --git a/tools/testing/dart/vendored_pkg/args/args.dart b/tools/testing/dart/vendored_pkg/args/args.dart
index 6d4b6de6c04c9f365d452177c4859e1571c1c468..af9db87e4243b7c0c1d17832b132ee7e3df43eec 100644
--- a/tools/testing/dart/vendored_pkg/args/args.dart
+++ b/tools/testing/dart/vendored_pkg/args/args.dart
@@ -277,15 +277,23 @@ class ArgParser {
List<String> allowed,
Map<String, String> allowedHelp,
String defaultsTo,
- void callback(value),
+ void callback(dynamic value),
bool allowMultiple: false}) {
_addOption(name, abbr, help, allowed, allowedHelp, defaultsTo, callback,
isFlag: false, allowMultiple: allowMultiple);
}
- void _addOption(String name, String abbr, String help, List<String> allowed,
- Map<String, String> allowedHelp, defaultsTo, void callback(value),
- {bool isFlag, bool negatable: false, bool allowMultiple: false}) {
+ void _addOption(
+ String name,
+ String abbr,
+ String help,
+ List<String> allowed,
+ Map<String, String> allowedHelp,
+ dynamic defaultsTo,
+ void callback(dynamic value),
+ {bool isFlag,
+ bool negatable: false,
+ bool allowMultiple: false}) {
// Make sure the name isn't in use.
if (options.containsKey(name)) {
throw new ArgumentError('Duplicate option "$name".');
@@ -327,7 +335,7 @@ class ArgParser {
* Get the default value for an option. Useful after parsing to test
* if the user specified something other than the default.
*/
- getDefault(String option) {
+ dynamic getDefault(String option) {
if (!options.containsKey(option)) {
throw new ArgumentError('No option named $option');
}
@@ -351,7 +359,7 @@ class Option {
final String name;
final String abbreviation;
final List allowed;
- final defaultValue;
+ final dynamic defaultValue;
final Function callback;
final String help;
final Map<String, String> allowedHelp;
@@ -370,7 +378,7 @@ class Option {
* command line arguments.
*/
class ArgResults {
- final Map _options;
+ final Map<String, dynamic> _options;
/**
* If these are the results for parsing a command's options, this will be
@@ -395,7 +403,7 @@ class ArgResults {
ArgResults(this._options, this.name, this.command, this.rest);
/** Gets the parsed command-line option named [name]. */
- operator [](String name) {
+ dynamic operator [](String name) {
if (!_options.containsKey(name)) {
throw new ArgumentError('Could not find an option named "$name".');
}
« no previous file with comments | « tools/testing/dart/utils.dart ('k') | tools/testing/dart/vendored_pkg/args/src/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698