This article covers features introduced in SpiderMonkey 1.8.6
Parse a string using the JSON syntax described in ECMAScript 5 and return the corresponding value.
JSBool JS_ParseJSON(JSContext *cx, const jschar *chars, uint32 len, jsval *vp); JSBool JS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32 len, jsval reviver, jsval *vp);
| || ||Pointer to a JS context. Requires request. In a |
| || ||The object to be searched.|
|chars|| ||The characters of the string.|
| || ||The length of the string.|
| || ||(in |
| || ||Out parameter. |
Use these functions to parse a sequence of characters as JSON. The parsing rules applied by these methods are exactly those specified by ECMAScript 5. Various JSON extensions like trailing commas, unquoted property names, more generous number parsing, and so on are not supported.