mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibJS+LibWeb: Convert empty PrimitiveString instances to String
This commit is contained in:
parent
e99a4ba7c8
commit
49e8dcf0b2
Notes:
sideshowbarker
2024-07-17 23:07:41 +09:00
Author: https://github.com/trflynn89
Commit: 49e8dcf0b2
Pull-request: https://github.com/SerenityOS/serenity/pull/17388
Reviewed-by: https://github.com/linusg
9 changed files with 26 additions and 26 deletions
|
@ -129,7 +129,7 @@ WebIDL::ExceptionOr<JS::Value> XMLHttpRequest::response()
|
|||
if (m_response_type == Bindings::XMLHttpRequestResponseType::Empty || m_response_type == Bindings::XMLHttpRequestResponseType::Text) {
|
||||
// 1. If this’s state is not loading or done, then return the empty string.
|
||||
if (m_state != State::Loading && m_state != State::Done)
|
||||
return JS::PrimitiveString::create(vm, "");
|
||||
return JS::PrimitiveString::create(vm, String {});
|
||||
|
||||
// 2. Return the result of getting a text response for this.
|
||||
return JS::PrimitiveString::create(vm, get_text_response());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue