mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 12:06:07 +00:00
LibWeb: Implement JS value <-> JSON parsing/serialization AOs
This commit is contained in:
parent
4e536eaf98
commit
00fa71725b
Notes:
sideshowbarker
2024-07-17 06:36:47 +09:00
Author: https://github.com/linusg
Commit: 00fa71725b
Pull-request: https://github.com/SerenityOS/serenity/pull/15359
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/davidot ✅
Reviewed-by: https://github.com/kennethmyhra
3 changed files with 86 additions and 0 deletions
20
Userland/Libraries/LibWeb/Infra/JSON.h
Normal file
20
Userland/Libraries/LibWeb/Infra/JSON.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Forward.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::Infra {
|
||||
|
||||
WebIDL::ExceptionOr<JS::Value> parse_json_string_to_javascript_value(JS::VM&, StringView);
|
||||
WebIDL::ExceptionOr<JS::Value> parse_json_bytes_to_javascript_value(JS::VM&, ReadonlyBytes);
|
||||
WebIDL::ExceptionOr<String> serialize_javascript_value_to_json_string(JS::VM&, JS::Value);
|
||||
WebIDL::ExceptionOr<ByteBuffer> serialize_javascript_value_to_json_bytes(JS::VM&, JS::Value);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue