From 8ceef031e89749dd7c5cab1801fcd72006c2f734 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 16 Aug 2022 00:20:49 +0100 Subject: [PATCH] LibWeb: Fix the prototype of a couple of WebAssembly prototype objects Like any other regular, non-inheriting web platform prototype, the prototype's prototype should be Object.prototype, not the global object. Another reason to get rid of "global object (an object) + prototype object (also an object)"-style APIs for allocation :^) --- .../LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.h | 2 +- .../Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.h | 2 +- .../Libraries/LibWeb/WebAssembly/WebAssemblyModulePrototype.h | 2 +- .../Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.h b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.h index fff25310e1..2fb24d861d 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.h +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyInstanceObjectPrototype.h @@ -18,7 +18,7 @@ class WebAssemblyInstancePrototype final : public JS::Object { public: explicit WebAssemblyInstancePrototype(JS::GlobalObject& global_object) - : Object(global_object) + : JS::Object(*global_object.object_prototype()) { } diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.h b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.h index 74fd7b0322..4de2a28371 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.h +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.h @@ -20,7 +20,7 @@ class WebAssemblyMemoryPrototype final : public JS::Object { public: explicit WebAssemblyMemoryPrototype(JS::GlobalObject& global_object) - : JS::Object(global_object) + : JS::Object(*global_object.object_prototype()) { } diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModulePrototype.h b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModulePrototype.h index d0b6b953fe..eaf3c84178 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModulePrototype.h +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModulePrototype.h @@ -20,7 +20,7 @@ class WebAssemblyModulePrototype final : public JS::Object { public: explicit WebAssemblyModulePrototype(JS::GlobalObject& global_object) - : JS::Object(global_object) + : JS::Object(*global_object.object_prototype()) { } }; diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.h b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.h index e3075c63ae..18c66c7869 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.h +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.h @@ -20,7 +20,7 @@ class WebAssemblyTablePrototype final : public JS::Object { public: explicit WebAssemblyTablePrototype(JS::GlobalObject& global_object) - : JS::Object(global_object) + : JS::Object(*global_object.object_prototype()) { }