summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-10-04 18:07:43 +0100
committerLinus Groh <mail@linusgroh.de>2022-10-04 20:05:09 +0100
commit58b0edef7da5eaf4f76f1cdee26d27ea1951d793 (patch)
treed7af5f341e3edcf6cb10a2b6b41d4116e13f4166 /Userland
parent183462acfd03aae8dab48375a45e5079f8cbcab4 (diff)
downloadserenity-58b0edef7da5eaf4f76f1cdee26d27ea1951d793.zip
LibWeb: Remove redundant JS::Value() calls in XMLHttpRequest::response()
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
index 648ffbe0dd..285259af87 100644
--- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
+++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp
@@ -103,10 +103,10 @@ 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_ready_state != ReadyState::Loading && m_ready_state != ReadyState::Done)
- return JS::Value(JS::js_string(vm, ""));
+ return JS::js_string(vm, "");
// 2. Return the result of getting a text response for this.
- return JS::Value(JS::js_string(vm, get_text_response()));
+ return JS::js_string(vm, get_text_response());
}
// 2. If this’s state is not done, then return null.
if (m_ready_state != ReadyState::Done)
@@ -152,12 +152,12 @@ WebIDL::ExceptionOr<JS::Value> XMLHttpRequest::response()
// 2. If this’s response’s body is null, then return null.
// FIXME: Implement this once we have 'Response'.
if (m_received_bytes.is_empty())
- return JS::Value(JS::js_null());
+ return JS::js_null();
// 3. Let jsonObject be the result of running parse JSON from bytes on this’s received bytes. If that threw an exception, then return null.
auto json_object_result = Infra::parse_json_bytes_to_javascript_value(vm, m_received_bytes);
if (json_object_result.is_error())
- return JS::Value(JS::js_null());
+ return JS::js_null();
// 4. Set this’s response object to jsonObject.
m_response_object = json_object_result.release_value();