LibJS: Set empty prototype for console object

This commit is contained in:
Gasim Gasimzada 2024-08-08 20:21:06 +02:00 committed by Tim Ledbetter
commit 4a42c97f4d
Notes: github-actions[bot] 2024-08-12 16:21:57 +00:00
6 changed files with 87 additions and 1 deletions

View file

@ -8,14 +8,20 @@
#include <LibJS/Console.h>
#include <LibJS/Runtime/ConsoleObject.h>
#include <LibJS/Runtime/ConsoleObjectPrototype.h>
#include <LibJS/Runtime/GlobalObject.h>
namespace JS {
JS_DEFINE_ALLOCATOR(ConsoleObject);
static NonnullGCPtr<ConsoleObjectPrototype> create_console_prototype(Realm& realm)
{
return realm.heap().allocate<ConsoleObjectPrototype>(realm, realm);
}
ConsoleObject::ConsoleObject(Realm& realm)
: Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype())
: Object(ConstructWithPrototypeTag::Tag, create_console_prototype(realm))
{
}