mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 23:30:20 +00:00
LibJS: Add JSON.parse
This commit is contained in:
parent
e8e728454c
commit
b155e64b67
Notes:
sideshowbarker
2024-07-19 05:40:42 +09:00
Author: https://github.com/mattco98
Commit: b155e64b67
Pull-request: https://github.com/SerenityOS/serenity/pull/2545
Reviewed-by: https://github.com/Dexesttp
Reviewed-by: https://github.com/awesomekling
6 changed files with 218 additions and 5 deletions
|
@ -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&);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue