1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

LibWeb: Use "WebAssembly.Foo" in exception error messages

Not just "Foo" or "WebAssemblyFoo". This is how it's accessed from the
outside (JS).
Also fix one case of "not an" => "not a".
This commit is contained in:
Linus Groh 2021-07-05 12:31:03 +01:00
parent d713a84851
commit 79d8326370
5 changed files with 6 additions and 6 deletions

View file

@ -26,7 +26,7 @@ WebAssemblyInstanceConstructor::~WebAssemblyInstanceConstructor()
JS::Value WebAssemblyInstanceConstructor::call() JS::Value WebAssemblyInstanceConstructor::call()
{ {
vm().throw_exception<JS::TypeError>(global_object(), JS::ErrorType::ConstructorWithoutNew, "WebAssemblyInstance"); vm().throw_exception<JS::TypeError>(global_object(), JS::ErrorType::ConstructorWithoutNew, "WebAssembly.Instance");
return {}; return {};
} }

View file

@ -22,7 +22,7 @@ JS_DEFINE_NATIVE_GETTER(WebAssemblyInstancePrototype::exports_getter)
if (vm.exception()) if (vm.exception())
return {}; return {};
if (!is<WebAssemblyInstanceObject>(this_object)) { if (!is<WebAssemblyInstanceObject>(this_object)) {
vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAn, "WebAssemblyInstance"); vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotA, "WebAssembly.Instance");
return {}; return {};
} }
auto object = static_cast<WebAssemblyInstanceObject*>(this_object); auto object = static_cast<WebAssemblyInstanceObject*>(this_object);

View file

@ -24,7 +24,7 @@ WebAssemblyMemoryConstructor::~WebAssemblyMemoryConstructor()
JS::Value WebAssemblyMemoryConstructor::call() JS::Value WebAssemblyMemoryConstructor::call()
{ {
vm().throw_exception<JS::TypeError>(global_object(), JS::ErrorType::ConstructorWithoutNew, "WebAssemblyMemory"); vm().throw_exception<JS::TypeError>(global_object(), JS::ErrorType::ConstructorWithoutNew, "WebAssembly.Memory");
return {}; return {};
} }

View file

@ -24,7 +24,7 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyMemoryPrototype::grow)
return {}; return {};
auto* this_object = vm.this_value(global_object).to_object(global_object); auto* this_object = vm.this_value(global_object).to_object(global_object);
if (!this_object || !is<WebAssemblyMemoryObject>(this_object)) { if (!this_object || !is<WebAssemblyMemoryObject>(this_object)) {
vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotA, "Memory"); vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotA, "WebAssembly.Memory");
return {}; return {};
} }
auto* memory_object = static_cast<WebAssemblyMemoryObject*>(this_object); auto* memory_object = static_cast<WebAssemblyMemoryObject*>(this_object);
@ -46,7 +46,7 @@ JS_DEFINE_NATIVE_GETTER(WebAssemblyMemoryPrototype::buffer_getter)
{ {
auto* this_object = vm.this_value(global_object).to_object(global_object); auto* this_object = vm.this_value(global_object).to_object(global_object);
if (!this_object || !is<WebAssemblyMemoryObject>(this_object)) { if (!this_object || !is<WebAssemblyMemoryObject>(this_object)) {
vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotA, "Memory"); vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotA, "WebAssembly.Memory");
return {}; return {};
} }
auto* memory_object = static_cast<WebAssemblyMemoryObject*>(this_object); auto* memory_object = static_cast<WebAssemblyMemoryObject*>(this_object);

View file

@ -26,7 +26,7 @@ WebAssemblyModuleConstructor::~WebAssemblyModuleConstructor()
JS::Value WebAssemblyModuleConstructor::call() JS::Value WebAssemblyModuleConstructor::call()
{ {
vm().throw_exception<JS::TypeError>(global_object(), JS::ErrorType::ConstructorWithoutNew, "WebAssemblyModule"); vm().throw_exception<JS::TypeError>(global_object(), JS::ErrorType::ConstructorWithoutNew, "WebAssembly.Module");
return {}; return {};
} }