mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-21 10:32:51 +00:00
LibJS: Make PrimitiveString::deprecated_string() infallible
Work towards #20449.
This commit is contained in:
parent
c084269e5f
commit
09547ec975
Notes:
sideshowbarker
2024-07-16 20:08:14 +09:00
Author: https://github.com/awesomekling
Commit: 09547ec975
Pull-request: https://github.com/SerenityOS/serenity/pull/20451
Reviewed-by: https://github.com/trflynn89
17 changed files with 42 additions and 43 deletions
|
@ -99,7 +99,7 @@ static ErrorOr<JsonValue, ExecuteScriptResultType> internal_json_clone_algorithm
|
|||
if (value.is_number())
|
||||
return JsonValue { value.as_double() };
|
||||
if (value.is_string())
|
||||
return JsonValue { TRY_OR_JS_ERROR(value.as_string().deprecated_string()) };
|
||||
return JsonValue { value.as_string().deprecated_string() };
|
||||
|
||||
// NOTE: BigInt and Symbol not mentioned anywhere in the WebDriver spec, as it references ES5.
|
||||
// It assumes that all primitives are handled above, and the value is an object for the remaining steps.
|
||||
|
@ -130,7 +130,7 @@ static ErrorOr<JsonValue, ExecuteScriptResultType> internal_json_clone_algorithm
|
|||
auto to_json_result = TRY_OR_JS_ERROR(to_json.as_function().internal_call(value, JS::MarkedVector<JS::Value> { vm.heap() }));
|
||||
if (!to_json_result.is_string())
|
||||
return ExecuteScriptResultType::JavaScriptError;
|
||||
return TRY_OR_JS_ERROR(to_json_result.as_string().deprecated_string());
|
||||
return to_json_result.as_string().deprecated_string();
|
||||
}
|
||||
|
||||
// -> Otherwise
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue