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

Side by Side Diff: runtime/lib/convert_patch.dart

Issue 680073002: Fix type-errors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | tests/co19/co19-dart2js.status » ('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 import "dart:_internal" show POWERS_OF_TEN; 5 import "dart:_internal" show POWERS_OF_TEN;
6 6
7 // JSON conversion. 7 // JSON conversion.
8 8
9 patch _parseJson(String json, reviver(var key, var value)) { 9 patch _parseJson(String json, reviver(var key, var value)) {
10 _BuildJsonListener listener; 10 _BuildJsonListener listener;
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 addSlice(chunk, 0, chunk.length, false); 1364 addSlice(chunk, 0, chunk.length, false);
1365 } 1365 }
1366 1366
1367 void close() { 1367 void close() {
1368 _parser.close(); 1368 _parser.close();
1369 var decoded = _parser.result; 1369 var decoded = _parser.result;
1370 _sink.add(decoded); 1370 _sink.add(decoded);
1371 _sink.close(); 1371 _sink.close();
1372 } 1372 }
1373 1373
1374 Utf8ConversionSink asUtf8Sink(bool allowMalformed) { 1374 ByteConversionSink asUtf8Sink(bool allowMalformed) {
1375 _parser = null; 1375 _parser = null;
1376 return new _JsonUtf8DecoderSink(_reviver, _sink, allowMalformed); 1376 return new _JsonUtf8DecoderSink(_reviver, _sink, allowMalformed);
1377 } 1377 }
1378 } 1378 }
1379 1379
1380 class _Utf8StringBuffer { 1380 class _Utf8StringBuffer {
1381 static const int INITIAL_CAPACITY = 32; 1381 static const int INITIAL_CAPACITY = 32;
1382 // Partial state encoding. 1382 // Partial state encoding.
1383 static const int MASK_TWO_BIT = 0x03; 1383 static const int MASK_TWO_BIT = 0x03;
1384 static const int MASK_SIZE = MASK_TWO_BIT; 1384 static const int MASK_SIZE = MASK_TWO_BIT;
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 } 1672 }
1673 1673
1674 double _parseDouble(String source, int start, int end) 1674 double _parseDouble(String source, int start, int end)
1675 native "Double_parse"; 1675 native "Double_parse";
1676 1676
1677 /** 1677 /**
1678 * Implements the chunked conversion from a UTF-8 encoding of JSON 1678 * Implements the chunked conversion from a UTF-8 encoding of JSON
1679 * to its corresponding object. 1679 * to its corresponding object.
1680 */ 1680 */
1681 class _JsonUtf8DecoderSink extends ByteConversionSinkBase { 1681 class _JsonUtf8DecoderSink extends ByteConversionSinkBase {
1682 _ChunkedUtf8Parser _parser; 1682 _JsonUtf8Parser _parser;
1683 final Sink<Object> _sink; 1683 final Sink<Object> _sink;
1684 1684
1685 _JsonUtf8DecoderSink(reviver, this._sink, bool allowMalformed) 1685 _JsonUtf8DecoderSink(reviver, this._sink, bool allowMalformed)
1686 : _parser = _createParser(reviver, allowMalformed); 1686 : _parser = _createParser(reviver, allowMalformed);
1687 1687
1688 static _ChunkedJsonParser _createParser(reviver, bool allowMalformed) { 1688 static _ChunkedJsonParser _createParser(reviver, bool allowMalformed) {
1689 _BuildJsonListener listener; 1689 _BuildJsonListener listener;
1690 if (reviver == null) { 1690 if (reviver == null) {
1691 listener = new _BuildJsonListener(); 1691 listener = new _BuildJsonListener();
1692 } else { 1692 } else {
(...skipping 17 matching lines...) Expand all
1710 _parser.parse(start); 1710 _parser.parse(start);
1711 } 1711 }
1712 1712
1713 void close() { 1713 void close() {
1714 _parser.close(); 1714 _parser.close();
1715 var decoded = _parser.result; 1715 var decoded = _parser.result;
1716 _sink.add(decoded); 1716 _sink.add(decoded);
1717 _sink.close(); 1717 _sink.close();
1718 } 1718 }
1719 } 1719 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698