| 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 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 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1660 return buffer.toString(); | 1660 return buffer.toString(); |
| 1661 } | 1661 } |
| 1662 | 1662 |
| 1663 void copyCharsToList(int start, int end, List target, int offset) { | 1663 void copyCharsToList(int start, int end, List target, int offset) { |
| 1664 int length = end - start; | 1664 int length = end - start; |
| 1665 target.setRange(offset, offset + length, chunk, start); | 1665 target.setRange(offset, offset + length, chunk, start); |
| 1666 } | 1666 } |
| 1667 | 1667 |
| 1668 double parseDouble(int start, int end) { | 1668 double parseDouble(int start, int end) { |
| 1669 String string = getString(start, end); | 1669 String string = getString(start, end); |
| 1670 reutrn _parseDouble(string, 0, string.length); | 1670 return _parseDouble(string, 0, string.length); |
| 1671 } | 1671 } |
| 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 */ |
| (...skipping 29 matching lines...) Expand all Loading... |
| 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 } |
| OLD | NEW |