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

Unified Diff: sdk/lib/convert/json.dart

Issue 2035473003: Avoid runtime type errors in checked mode for ChunkedConverters. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « sdk/lib/convert/html_escape.dart ('k') | sdk/lib/convert/line_splitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/convert/json.dart
diff --git a/sdk/lib/convert/json.dart b/sdk/lib/convert/json.dart
index 24931df19496e9b18f0a7f6aa101a553b1ddebb0..3d5ee82989be0b8ca3028b3a3c08c0dd7b463ed7 100644
--- a/sdk/lib/convert/json.dart
+++ b/sdk/lib/convert/json.dart
@@ -159,7 +159,8 @@ class JsonCodec extends Codec<Object, String> {
/**
* This class converts JSON objects to strings.
*/
-class JsonEncoder extends Converter<Object, String> {
+class JsonEncoder extends Converter<Object, String>
+ implements ChunkedConverter<Object, String, Object, String> {
/**
* The string used for indention.
*
@@ -284,7 +285,9 @@ class JsonEncoder extends Converter<Object, String> {
* a JSON string, and then UTF-8 encoding the string, but without
* creating an intermediate string.
*/
-class JsonUtf8Encoder extends Converter<Object, List<int>> {
+class JsonUtf8Encoder extends Converter<Object, List<int>>
+ implements ChunkedConverter<Object, List<int>, Object, List<int>> {
+
/** Default buffer size used by the JSON-to-UTF-8 encoder. */
static const int DEFAULT_BUFFER_SIZE = 256;
/** Indentation used in pretty-print mode, `null` if not pretty. */
@@ -470,7 +473,8 @@ class _JsonUtf8EncoderSink extends ChunkedConversionSink<Object> {
/**
* This class parses JSON strings and builds the corresponding objects.
*/
-class JsonDecoder extends Converter<String, Object> {
+class JsonDecoder extends Converter<String, Object>
+ implements ChunkedConverter<String, Object, String, Object> {
final _Reviver _reviver;
/**
* Constructs a new JsonDecoder.
« no previous file with comments | « sdk/lib/convert/html_escape.dart ('k') | sdk/lib/convert/line_splitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698