1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:07:35 +00:00

LibWeb: Use is<T> in XMLHttpRequestPrototype

This commit is contained in:
Andreas Kling 2021-01-01 22:37:59 +01:00
parent 8ff61698da
commit 19ffa676f2

View file

@ -62,7 +62,7 @@ static XMLHttpRequest* impl_from(JS::VM& vm, JS::GlobalObject& global_object)
auto* this_object = vm.this_value(global_object).to_object(global_object);
if (!this_object)
return nullptr;
if (StringView("XMLHttpRequestWrapper") != this_object->class_name()) {
if (!is<XMLHttpRequestWrapper>(this_object)) {
vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotA, "XMLHttpRequest");
return nullptr;
}