mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +00:00
LibWeb: Disallow construction of XMLHttpRequest without 'new'
The XMLHttpRequest interface only has a constructor and isn't supposed to be callable as a function. https://xhr.spec.whatwg.org/#constructors
This commit is contained in:
parent
bdb924522f
commit
5e9f6f2e2c
Notes:
sideshowbarker
2024-07-19 00:57:53 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/5e9f6f2e2c3 Pull-request: https://github.com/SerenityOS/serenity/pull/4363
1 changed files with 2 additions and 1 deletions
|
@ -57,7 +57,8 @@ XMLHttpRequestConstructor::~XMLHttpRequestConstructor()
|
|||
|
||||
JS::Value XMLHttpRequestConstructor::call()
|
||||
{
|
||||
return construct(*this);
|
||||
vm().throw_exception<JS::TypeError>(global_object(), JS::ErrorType::ConstructorWithoutNew, "XMLHttpRequest");
|
||||
return {};
|
||||
}
|
||||
|
||||
JS::Value XMLHttpRequestConstructor::construct(Function&)
|
||||
|
|
Loading…
Add table
Reference in a new issue