diff options
author | Matthew Olsson <matthewcolsson@gmail.com> | 2020-06-10 23:30:36 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-13 12:43:22 +0200 |
commit | b155e64b67e555c44226c715d537ecf6c34e49f0 (patch) | |
tree | 50b55dee5733f104b04c642b281f800face9affb /Libraries/LibJS/Runtime/JSONObject.h | |
parent | e8e728454c5d436a02eaa1d24bc3afe357090c52 (diff) | |
download | serenity-b155e64b67e555c44226c715d537ecf6c34e49f0.zip |
LibJS: Add JSON.parse
Diffstat (limited to 'Libraries/LibJS/Runtime/JSONObject.h')
-rw-r--r-- | Libraries/LibJS/Runtime/JSONObject.h | 8 |
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&); }; |