mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:57:35 +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
1 changed files with 2 additions and 1 deletions
|
@ -57,7 +57,8 @@ XMLHttpRequestConstructor::~XMLHttpRequestConstructor()
|
||||||
|
|
||||||
JS::Value XMLHttpRequestConstructor::call()
|
JS::Value XMLHttpRequestConstructor::call()
|
||||||
{
|
{
|
||||||
return construct(*this);
|
vm().throw_exception<JS::TypeError>(global_object(), JS::ErrorType::ConstructorWithoutNew, "XMLHttpRequest");
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
JS::Value XMLHttpRequestConstructor::construct(Function&)
|
JS::Value XMLHttpRequestConstructor::construct(Function&)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue