| Index: pkg/analysis_server/lib/src/protocol.dart
|
| diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart
|
| index 85a762de026ce9d05552e8017357754a8d9e83a9..785a54f71e0da58e2f18d0aee0dc436f35cb3c68 100644
|
| --- a/pkg/analysis_server/lib/src/protocol.dart
|
| +++ b/pkg/analysis_server/lib/src/protocol.dart
|
| @@ -286,6 +286,23 @@ class RequestDatum {
|
| }
|
|
|
| /**
|
| + * Validate that the datum is a list, and return a list where each element in
|
| + * the datum has been converted using the provided function.
|
| + */
|
| + List asList(elementConverter(RequestDatum datum)) {
|
| + if (datum is! List) {
|
| + throw new RequestFailure(new Response.invalidParameter(request, path,
|
| + "be a list"));
|
| + }
|
| + List list = datum as List;
|
| + List result = [];
|
| + for (int i = 0; i < list.length; i++) {
|
| + result.add(elementConverter(new RequestDatum(request, "$path.$i", list[i])));
|
| + }
|
| + return result;
|
| + }
|
| +
|
| + /**
|
| * Validate that the datum is a string, and return it.
|
| */
|
| String asString() {
|
|
|