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

Unified Diff: pkg/analysis_server/lib/src/protocol.dart

Issue 288013003: allow client to specify any combination of add/modified/removed (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge and address comments Created 6 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 | « pkg/analysis_server/lib/src/domain_context.dart ('k') | pkg/analysis_server/test/domain_context_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7cdfa18de0c22eb00ea302288a470cda0cc29a96..2c4ecfb258e5aca1dddae53b172134cf60e7ab05 100644
--- a/pkg/analysis_server/lib/src/protocol.dart
+++ b/pkg/analysis_server/lib/src/protocol.dart
@@ -185,6 +185,17 @@ class RequestDatum {
}
/**
+ * Return `true` if the datum is a Map containing the given [key].
+ */
+ bool hasKey(String key) {
+ if (datum is! Map<String, dynamic>) {
+ throw new RequestFailure(new Response.invalidParameter(request, path,
+ "be a map"));
+ }
+ return datum.containsKey(key);
+ }
+
+ /**
* Validate that the datum is a Map whose keys are strings, and call [f] on
* each key/value pair in the map.
*/
« no previous file with comments | « pkg/analysis_server/lib/src/domain_context.dart ('k') | pkg/analysis_server/test/domain_context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698