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

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

Issue 284353002: implement ByteStreamClientChannel close (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: revert formatting changes 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 | « no previous file | pkg/analysis_server/test/channel_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/channel.dart
diff --git a/pkg/analysis_server/lib/src/channel.dart b/pkg/analysis_server/lib/src/channel.dart
index 7ffec7044833e2722daf9ee10dc2c34611357301..2a3dd9385a56ad6c483a58042b058b3aff5bb43e 100644
--- a/pkg/analysis_server/lib/src/channel.dart
+++ b/pkg/analysis_server/lib/src/channel.dart
@@ -202,7 +202,7 @@ class ByteStreamClientChannel implements ClientCommunicationChannel {
@override
Future close() {
- // TODO: implement close
+ return output.close();
}
@override
@@ -279,7 +279,12 @@ class ByteStreamServerChannel implements ServerCommunicationChannel {
*/
class JsonStreamDecoder extends Converter<String, Map> {
@override
- Map convert(String text) => JSON.decode(text);
+ Map convert(String text) {
+ if (text == null || text.isEmpty || text[0] != '{') {
Paul Berry 2014/05/16 18:01:27 Is this an intentional part of the CL? What's the
danrubel 2014/05/19 17:32:25 This is to allow stack traces from the analysis se
+ return null;
+ }
+ return JSON.decode(text);
+ }
@override
ChunkedConversionSink startChunkedConversion(Sink sink) =>
« no previous file with comments | « no previous file | pkg/analysis_server/test/channel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698