From de4cbc8f08dcf57bdb7312fe1f4f112710766eca Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Thu, 1 Jul 2021 15:12:33 +0430 Subject: LibWeb: Use the correct name to refer to WebAssembly.Memory.prototype Otherwise `instanceof` wouldn't return the correct result. --- .../Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp | 2 +- Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Userland/Libraries/LibWeb/WebAssembly') diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp index f6c0e8dc4c..ed5a454ffa 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp @@ -72,7 +72,7 @@ void WebAssemblyMemoryConstructor::initialize(JS::GlobalObject& global_object) auto& window = static_cast(global_object); NativeFunction::initialize(global_object); - define_property(vm.names.prototype, &window.ensure_web_prototype("WebAssembly.Memory")); + define_property(vm.names.prototype, &window.ensure_web_prototype("WebAssemblyMemoryPrototype")); define_property(vm.names.length, JS::Value(1), JS::Attribute::Configurable); } diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp index f33b78d24d..03f0f01261 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp @@ -33,7 +33,7 @@ void WebAssemblyObject::initialize(JS::GlobalObject& global_object) auto& vm = global_object.vm(); auto& window = static_cast(global_object); - auto& memory_constructor = window.ensure_web_prototype("WebAssembly.Memory"); + auto& memory_constructor = window.ensure_web_constructor("WebAssembly.Memory"); memory_constructor.define_property(vm.names.name, js_string(vm, "WebAssembly.Memory"), JS::Attribute::Configurable); auto& memory_prototype = window.ensure_web_prototype("WebAssemblyMemoryPrototype"); memory_prototype.define_property(vm.names.constructor, &memory_constructor, JS::Attribute::Writable | JS::Attribute::Configurable); @@ -420,7 +420,7 @@ JS::NativeFunction* create_native_function(Wasm::FunctionAddress address, String } WebAssemblyMemoryObject::WebAssemblyMemoryObject(JS::GlobalObject& global_object, Wasm::MemoryAddress address) - : Object(static_cast(global_object).ensure_web_prototype(class_name())) + : Object(static_cast(global_object).ensure_web_prototype("WebAssemblyMemoryPrototype")) , m_address(address) { } -- cgit v1.2.3