From 79d8326370caf535d4f46689c4c1ff1a5ccacbd6 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 5 Jul 2021 12:31:03 +0100 Subject: [PATCH] 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". --- .../LibWeb/WebAssembly/WebAssemblyInstanceConstructor.cpp | 2 +- .../LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.cpp | 2 +- .../LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp | 2 +- .../LibWeb/WebAssembly/WebAssemblyMemoryPrototype.cpp | 4 ++-- .../LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceConstructor.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceConstructor.cpp index 7ec16d6862..b74870e368 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceConstructor.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceConstructor.cpp @@ -26,7 +26,7 @@ WebAssemblyInstanceConstructor::~WebAssemblyInstanceConstructor() JS::Value WebAssemblyInstanceConstructor::call() { - vm().throw_exception(global_object(), JS::ErrorType::ConstructorWithoutNew, "WebAssemblyInstance"); + vm().throw_exception(global_object(), JS::ErrorType::ConstructorWithoutNew, "WebAssembly.Instance"); return {}; } diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.cpp index 3de1657f39..19178d4b88 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.cpp @@ -22,7 +22,7 @@ JS_DEFINE_NATIVE_GETTER(WebAssemblyInstancePrototype::exports_getter) if (vm.exception()) return {}; if (!is(this_object)) { - vm.throw_exception(global_object, JS::ErrorType::NotAn, "WebAssemblyInstance"); + vm.throw_exception(global_object, JS::ErrorType::NotA, "WebAssembly.Instance"); return {}; } auto object = static_cast(this_object); diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp index 972266119f..625a76ee35 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp @@ -24,7 +24,7 @@ WebAssemblyMemoryConstructor::~WebAssemblyMemoryConstructor() JS::Value WebAssemblyMemoryConstructor::call() { - vm().throw_exception(global_object(), JS::ErrorType::ConstructorWithoutNew, "WebAssemblyMemory"); + vm().throw_exception(global_object(), JS::ErrorType::ConstructorWithoutNew, "WebAssembly.Memory"); return {}; } diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.cpp index c5f32d0591..28cb46d635 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.cpp @@ -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(this_object)) { - vm.throw_exception(global_object, JS::ErrorType::NotA, "Memory"); + vm.throw_exception(global_object, JS::ErrorType::NotA, "WebAssembly.Memory"); return {}; } auto* memory_object = static_cast(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(this_object)) { - vm.throw_exception(global_object, JS::ErrorType::NotA, "Memory"); + vm.throw_exception(global_object, JS::ErrorType::NotA, "WebAssembly.Memory"); return {}; } auto* memory_object = static_cast(this_object); diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp index f787f63ea7..59c7532910 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp @@ -26,7 +26,7 @@ WebAssemblyModuleConstructor::~WebAssemblyModuleConstructor() JS::Value WebAssemblyModuleConstructor::call() { - vm().throw_exception(global_object(), JS::ErrorType::ConstructorWithoutNew, "WebAssemblyModule"); + vm().throw_exception(global_object(), JS::ErrorType::ConstructorWithoutNew, "WebAssembly.Module"); return {}; }