ladybird/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleObject.cpp
Andreas Kling 4abdb68655 LibJS: Remove Object(Object& prototype) footgun
This constructor was easily confused with a copy constructor, and it was
possible to accidentally copy-construct Objects in at least one way that
we dicovered (via generic ThrowCompletionOr construction).

This patch adds a mandatory ConstructWithPrototypeTag parameter to the
constructor to disambiguate it.
2022-12-14 15:11:57 +01:00

19 lines
531 B
C++

/*
* Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "WebAssemblyModulePrototype.h"
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/WebAssembly/WebAssemblyModuleObject.h>
namespace Web::Bindings {
WebAssemblyModuleObject::WebAssemblyModuleObject(JS::Realm& realm, size_t index)
: Object(ConstructWithPrototypeTag::Tag, Bindings::ensure_web_prototype<WebAssemblyModulePrototype>(realm, "WebAssemblyModulePrototype"))
, m_index(index)
{
}
}