summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Runtime/JSONObject.h
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2020-06-10 23:30:36 -0700
committerAndreas Kling <kling@serenityos.org>2020-06-13 12:43:22 +0200
commitb155e64b67e555c44226c715d537ecf6c34e49f0 (patch)
tree50b55dee5733f104b04c642b281f800face9affb /Libraries/LibJS/Runtime/JSONObject.h
parente8e728454c5d436a02eaa1d24bc3afe357090c52 (diff)
downloadserenity-b155e64b67e555c44226c715d537ecf6c34e49f0.zip
LibJS: Add JSON.parse
Diffstat (limited to 'Libraries/LibJS/Runtime/JSONObject.h')
-rw-r--r--Libraries/LibJS/Runtime/JSONObject.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/Libraries/LibJS/Runtime/JSONObject.h b/Libraries/LibJS/Runtime/JSONObject.h
index fa5491b210..c9b8a488ef 100644
--- a/Libraries/LibJS/Runtime/JSONObject.h
+++ b/Libraries/LibJS/Runtime/JSONObject.h
@@ -26,8 +26,6 @@
#pragma once
-#include <LibJS/Runtime/Object.h>
-
namespace JS {
class JSONObject final : public Object {
@@ -52,6 +50,12 @@ private:
static String serialize_json_array(Interpreter&, StringifyState&, Object&);
static String quote_json_string(String);
+ // Parse helpers
+ static Object* parse_json_object(Interpreter&, const JsonObject&);
+ static Array* parse_json_array(Interpreter&, const JsonArray&);
+ static Value parse_json_value(Interpreter&, const JsonValue&);
+ static Value internalize_json_property(Interpreter&, Object* holder, const PropertyName& name, Function& reviver);
+
static Value stringify(Interpreter&);
static Value parse(Interpreter&);
};