diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-09-11 15:28:51 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-12 00:16:39 +0200 |
commit | c59b97043eaf72cdb757262354ddb34b79b127d2 (patch) | |
tree | 7707133c78319d05e37b596fa539d22ae4f9a7cf /Userland/Libraries/LibWeb/WebAssembly | |
parent | fd8ec1fffa587913e3079a2964c1d4a5076b2158 (diff) | |
download | serenity-c59b97043eaf72cdb757262354ddb34b79b127d2.zip |
LibWeb: Use ErrorType::NotAnObjectOfType instead of NotA
Diffstat (limited to 'Userland/Libraries/LibWeb/WebAssembly')
6 files changed, 10 insertions, 10 deletions
diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceConstructor.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceConstructor.cpp index 94953c0342..770249be7f 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceConstructor.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceConstructor.cpp @@ -39,7 +39,7 @@ JS::Value WebAssemblyInstanceConstructor::construct(FunctionObject&) return {}; if (!is<WebAssemblyModuleObject>(module_argument)) { - vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotA, "WebAssembly.Module"); + vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, "WebAssembly.Module"); return {}; } diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.cpp index 8b37f813de..924a6c1102 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.cpp @@ -23,7 +23,7 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyInstancePrototype::exports_getter) if (vm.exception()) return {}; if (!is<WebAssemblyInstanceObject>(this_object)) { - vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotA, "WebAssembly.Instance"); + vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, "WebAssembly.Instance"); return {}; } auto object = static_cast<WebAssemblyInstanceObject*>(this_object); diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp index 338dbcc959..deb27bd3bf 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp @@ -40,7 +40,7 @@ JS::Value WebAssemblyMemoryConstructor::construct(FunctionObject&) auto maximum_value = descriptor->get_without_side_effects("maximum"); if (initial_value.is_empty()) { - vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotA, "Number"); + vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, "Number"); return {}; } diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.cpp index 0655cdcc3a..1033bb8268 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<WebAssemblyMemoryObject>(this_object)) { - vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotA, "WebAssembly.Memory"); + vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, "WebAssembly.Memory"); return {}; } auto* memory_object = static_cast<WebAssemblyMemoryObject*>(this_object); @@ -46,7 +46,7 @@ JS_DEFINE_NATIVE_FUNCTION(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, "WebAssembly.Memory"); + vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, "WebAssembly.Memory"); return {}; } auto* memory_object = static_cast<WebAssemblyMemoryObject*>(this_object); diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp index aabe0d27c6..1f1459ef9a 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp @@ -428,7 +428,7 @@ Optional<Wasm::Value> to_webassembly_value(JS::Value value, const Wasm::ValueTyp } } - vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAn, "Exported function"); + vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, "Exported function"); return {}; } case Wasm::ValueType::ExternReference: diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.cpp index 161d413fdf..614c132228 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.cpp @@ -26,7 +26,7 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyTablePrototype::grow) return {}; auto* this_object = vm.this_value(global_object).to_object(global_object); if (!this_object || !is<WebAssemblyTableObject>(this_object)) { - vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotA, "WebAssembly.Table"); + vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, "WebAssembly.Table"); return {}; } auto* table_object = static_cast<WebAssemblyTableObject*>(this_object); @@ -65,7 +65,7 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyTablePrototype::get) auto* this_object = vm.this_value(global_object).to_object(global_object); if (!this_object || !is<WebAssemblyTableObject>(this_object)) { - vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotA, "WebAssembly.Table"); + vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, "WebAssembly.Table"); return {}; } auto* table_object = static_cast<WebAssemblyTableObject*>(this_object); @@ -95,7 +95,7 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyTablePrototype::set) auto* this_object = vm.this_value(global_object).to_object(global_object); if (!this_object || !is<WebAssemblyTableObject>(this_object)) { - vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotA, "WebAssembly.Table"); + vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, "WebAssembly.Table"); return {}; } auto* table_object = static_cast<WebAssemblyTableObject*>(this_object); @@ -130,7 +130,7 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyTablePrototype::length_getter) { auto* this_object = vm.this_value(global_object).to_object(global_object); if (!this_object || !is<WebAssemblyTableObject>(this_object)) { - vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotA, "WebAssembly.Table"); + vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, "WebAssembly.Table"); return {}; } auto* table_object = static_cast<WebAssemblyTableObject*>(this_object); |