| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
| 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. | |
| 4 | |
| 5 #library("json"); | |
| 6 #native("json.js"); | |
| 7 | |
| 8 /** | |
| 9 * Dart interface to JavaScript objects and JSON. | |
| 10 * (The native method implementations are in json.js.) | |
| 11 */ | |
| 12 class JSON native 'JSON' { | |
| 13 | |
| 14 /** | |
| 15 * Takes a string in JSON notation and returns the value it | |
| 16 * represents. The resulting value is one of the following: | |
| 17 * null | |
| 18 * a bool | |
| 19 * a double | |
| 20 * a String | |
| 21 * an Array of values (recursively) | |
| 22 * a Map from property names to values (recursively) | |
| 23 */ | |
| 24 static Object parse(String jsonString) native; | |
| 25 | |
| 26 /** | |
| 27 * Takes a value and returns a string in JSON notation | |
| 28 * representing its value, or returns null if the value is not representable | |
| 29 * in JSON. A representable value is one of the following: | |
| 30 * null | |
| 31 * a bool | |
| 32 * a double | |
| 33 * a String | |
| 34 * an Array of values (recursively) | |
| 35 * a Map from property names to values (recursively) | |
| 36 */ | |
| 37 static String stringify(Object value) native; | |
| 38 } | |
| OLD | NEW |