+ JSValue result = Stringifier(exec, replacer, space).stringify(value).get();
+ return JSValue::encode(result);
+}
+
+JSValue JSONParse(ExecState* exec, const String& json)
+{
+ LocalScope scope(exec->vm());
+
+ if (json.is8Bit()) {
+ LiteralParser<LChar> jsonParser(exec, json.characters8(), json.length(), StrictJSON);
+ return jsonParser.tryLiteralParse();
+ }
+
+ LiteralParser<UChar> jsonParser(exec, json.characters16(), json.length(), StrictJSON);
+ return jsonParser.tryLiteralParse();