mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibWeb: Bring XHR::open() closer to spec
FIXME addressed in open method: 10. If async is false, the current global object is a Window object, and either this’s timeout is not 0 or this’s response type is not the empty string, then throw an "InvalidAccessError" DOMException.
This commit is contained in:
parent
8eec25b7ae
commit
71228a8d86
1 changed files with 7 additions and 2 deletions
|
@ -381,8 +381,13 @@ WebIDL::ExceptionOr<void> XMLHttpRequest::open(String const& method_string, Stri
|
|||
parsed_url.set_password(password);
|
||||
}
|
||||
|
||||
// FIXME: 10. If async is false, the current global object is a Window object, and either this’s timeout is
|
||||
// not 0 or this’s response type is not the empty string, then throw an "InvalidAccessError" DOMException.
|
||||
// 10. If async is false, the current global object is a Window object, and either this’s timeout is
|
||||
// not 0 or this’s response type is not the empty string, then throw an "InvalidAccessError" DOMException.
|
||||
if (!async
|
||||
&& is<HTML::Window>(HTML::current_global_object())
|
||||
&& (m_timeout != 0 || m_response_type != Bindings::XMLHttpRequestResponseType::Empty)) {
|
||||
return WebIDL::InvalidAccessError::create(realm(), "synchronous XMLHttpRequests do not support timeout and responseType");
|
||||
}
|
||||
|
||||
// FIXME: 11. Terminate the ongoing fetch operated by the XMLHttpRequest object.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue