| OLD | NEW |
| 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:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:convert' show JsonDecoder; | 8 import 'dart:convert' show JsonDecoder; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 530 |
| 531 /** | 531 /** |
| 532 * Initialize a newly created instance to represent an error condition caused | 532 * Initialize a newly created instance to represent an error condition caused |
| 533 * by a `analysis.setPriorityFiles` [request] that includes one or more files | 533 * by a `analysis.setPriorityFiles` [request] that includes one or more files |
| 534 * that are not being analyzed. | 534 * that are not being analyzed. |
| 535 */ | 535 */ |
| 536 Response.unanalyzedPriorityFiles(Request request, String fileNames) | 536 Response.unanalyzedPriorityFiles(Request request, String fileNames) |
| 537 : this(request.id, new RequestError(-11, "Unanalyzed files cannot be a prior
ity: '$fileNames'")); | 537 : this(request.id, new RequestError(-11, "Unanalyzed files cannot be a prior
ity: '$fileNames'")); |
| 538 | 538 |
| 539 /** | 539 /** |
| 540 * Initialize a newly created instance to represent an error condition caused |
| 541 * by a `analysis.updateOptions` [request] that includes an unknown analysis |
| 542 * option. |
| 543 */ |
| 544 Response.unknownOptionName(Request request, String optionName) |
| 545 : this(request.id, new RequestError(-12, 'Unknown analysis option: "$optionN
ame"')); |
| 546 |
| 547 /** |
| 540 * Initialize a newly created instance based upon the given JSON data | 548 * Initialize a newly created instance based upon the given JSON data |
| 541 */ | 549 */ |
| 542 factory Response.fromJson(Map<String, Object> json) { | 550 factory Response.fromJson(Map<String, Object> json) { |
| 543 try { | 551 try { |
| 544 Object id = json[Response.ID]; | 552 Object id = json[Response.ID]; |
| 545 if (id is! String) { | 553 if (id is! String) { |
| 546 return null; | 554 return null; |
| 547 } | 555 } |
| 548 Object error = json[Response.ERROR]; | 556 Object error = json[Response.ERROR]; |
| 549 Object result = json[Response.RESULT]; | 557 Object result = json[Response.RESULT]; |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 /** | 877 /** |
| 870 * The response to be returned as a result of the failure. | 878 * The response to be returned as a result of the failure. |
| 871 */ | 879 */ |
| 872 final Response response; | 880 final Response response; |
| 873 | 881 |
| 874 /** | 882 /** |
| 875 * Initialize a newly created exception to return the given reponse. | 883 * Initialize a newly created exception to return the given reponse. |
| 876 */ | 884 */ |
| 877 RequestFailure(this.response); | 885 RequestFailure(this.response); |
| 878 } | 886 } |
| OLD | NEW |