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
Notes: sideshowbarker 2024-07-18 10:23:43 +09:00
5 changed files with 6 additions and 6 deletions

View File

@ -26,7 +26,7 @@ WebAssemblyInstanceConstructor::~WebAssemblyInstanceConstructor()
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 {};
}

View File

@ -22,7 +22,7 @@ JS_DEFINE_NATIVE_GETTER(WebAssemblyInstancePrototype::exports_getter)
if (vm.exception())
return {};
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 {};
}
auto object = static_cast<WebAssemblyInstanceObject*>(this_object);

View File

@ -24,7 +24,7 @@ WebAssemblyMemoryConstructor::~WebAssemblyMemoryConstructor()
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 {};
}

View File

@ -24,7 +24,7 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyMemoryPrototype::grow)
return {};
auto* this_object = vm.this_value(global_object).to_object(global_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 {};
}
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);
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 {};
}
auto* memory_object = static_cast<WebAssemblyMemoryObject*>(this_object);

View File

@ -26,7 +26,7 @@ WebAssemblyModuleConstructor::~WebAssemblyModuleConstructor()
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 {};
}