mirror of
https://github.com/RGBCube/serenity
synced 2025-07-04 15:17:35 +00:00
LibJS: Make PrimitiveString::deprecated_string() infallible
Work towards #20449.
This commit is contained in:
parent
c084269e5f
commit
09547ec975
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