summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-07-01 15:12:33 +0430
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-07-02 04:53:01 +0430
commitde4cbc8f08dcf57bdb7312fe1f4f112710766eca (patch)
tree71defef330ea49254f86f50d5dfc69e1639ef879 /Userland/Libraries
parentbfb3d9e9d03aeac338577fdcf72230c479602ca2 (diff)
downloadserenity-de4cbc8f08dcf57bdb7312fe1f4f112710766eca.zip
LibWeb: Use the correct name to refer to WebAssembly.Memory.prototype
Otherwise `instanceof` wouldn't return the correct result.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryConstructor.cpp2
-rw-r--r--Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp4
2 files changed, 3 insertions, 3 deletions
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<WindowObject&>(global_object);
NativeFunction::initialize(global_object);
- define_property(vm.names.prototype, &window.ensure_web_prototype<WebAssemblyMemoryPrototype>("WebAssembly.Memory"));
+ define_property(vm.names.prototype, &window.ensure_web_prototype<WebAssemblyMemoryPrototype>("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<WindowObject&>(global_object);
- auto& memory_constructor = window.ensure_web_prototype<WebAssemblyMemoryConstructor>("WebAssembly.Memory");
+ auto& memory_constructor = window.ensure_web_constructor<WebAssemblyMemoryConstructor>("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>("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<WindowObject&>(global_object).ensure_web_prototype<WebAssemblyMemoryPrototype>(class_name()))
+ : Object(static_cast<WindowObject&>(global_object).ensure_web_prototype<WebAssemblyMemoryPrototype>("WebAssemblyMemoryPrototype"))
, m_address(address)
{
}