| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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:typed_data"; | |
| 6 | |
| 7 // JSON conversion. | 5 // JSON conversion. |
| 8 | 6 |
| 9 patch _parseJson(String json, reviver(var key, var value)) { | 7 patch _parseJson(String json, reviver(var key, var value)) { |
| 10 _BuildJsonListener listener; | 8 _BuildJsonListener listener; |
| 11 if (reviver == null) { | 9 if (reviver == null) { |
| 12 listener = new _BuildJsonListener(); | 10 listener = new _BuildJsonListener(); |
| 13 } else { | 11 } else { |
| 14 listener = new _ReviverJsonListener(reviver); | 12 listener = new _ReviverJsonListener(reviver); |
| 15 } | 13 } |
| 16 new _JsonParser(json, listener).parse(); | 14 new _JsonParser(json, listener).parse(); |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 } | 566 } |
| 569 | 567 |
| 570 static double _parseDouble(String source, int start, int end) | 568 static double _parseDouble(String source, int start, int end) |
| 571 native "Double_parse"; | 569 native "Double_parse"; |
| 572 | 570 |
| 573 void fail(int position, [String message]) { | 571 void fail(int position, [String message]) { |
| 574 if (message == null) message = "Unexpected character"; | 572 if (message == null) message = "Unexpected character"; |
| 575 throw new FormatException(message, source, position); | 573 throw new FormatException(message, source, position); |
| 576 } | 574 } |
| 577 } | 575 } |
| OLD | NEW |