1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:38:11 +00:00

LibJS: Convert JSONObject functions to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-10-29 00:27:25 +03:00
parent 6b954b9e76
commit e7a134a346
3 changed files with 66 additions and 102 deletions

View file

@ -239,7 +239,7 @@ inline AK::Result<NonnullRefPtr<JS::SourceTextModule>, ParserError> parse_module
inline Optional<JsonValue> get_test_results(JS::Interpreter& interpreter)
{
auto results = MUST(interpreter.global_object().get("__TestResults__"));
auto json_string = JS::JSONObject::stringify_impl(interpreter.global_object(), results, JS::js_undefined(), JS::js_undefined());
auto json_string = TRY_OR_DISCARD(JS::JSONObject::stringify_impl(interpreter.global_object(), results, JS::js_undefined(), JS::js_undefined()));
auto json = JsonValue::from_string(json_string);
if (!json.has_value())