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

Side by Side Diff: pkg/analysis_server/lib/src/protocol.dart

Issue 152893004: (TBR) Fix test failures (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/test/protocol_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library protocol; 5 library protocol;
6 6
7 import 'dart:convert' show JsonDecoder; 7 import 'dart:convert' show JsonDecoder;
8 8
9 /** 9 /**
10 * Instances of the class [Request] represent a request that was received. 10 * Instances of the class [Request] represent a request that was received.
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 result[name] = value; 258 result[name] = value;
259 } 259 }
260 260
261 /** 261 /**
262 * Return a table representing the structure of the Json object that will be 262 * Return a table representing the structure of the Json object that will be
263 * sent to the client to represent this response. 263 * sent to the client to represent this response.
264 */ 264 */
265 Map<String, Object> toJson() { 265 Map<String, Object> toJson() {
266 Map jsonObject = new Map(); 266 Map jsonObject = new Map();
267 jsonObject[ID] = id; 267 jsonObject[ID] = id;
268 jsonObject[ERROR] = error.toJson(); 268 if (error == null) {
269 jsonObject[ERROR] = null;
270 } else {
271 jsonObject[ERROR] = error.toJson();
272 }
269 if (!result.isEmpty) { 273 if (!result.isEmpty) {
270 jsonObject[RESULT] = result; 274 jsonObject[RESULT] = result;
271 } 275 }
272 return jsonObject; 276 return jsonObject;
273 } 277 }
274 } 278 }
275 279
276 /** 280 /**
277 * Instances of the class [RequestError] represent information about an error th at 281 * Instances of the class [RequestError] represent information about an error th at
278 * occurred while attempting to respond to a [Request]. 282 * occurred while attempting to respond to a [Request].
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 /** 491 /**
488 * The response to be returned as a result of the failure. 492 * The response to be returned as a result of the failure.
489 */ 493 */
490 final Response response; 494 final Response response;
491 495
492 /** 496 /**
493 * Initialize a newly created exception to return the given reponse. 497 * Initialize a newly created exception to return the given reponse.
494 */ 498 */
495 RequestFailure(this.response); 499 RequestFailure(this.response);
496 } 500 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/protocol_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698