mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibJS: Set empty prototype for console object
This commit is contained in:
parent
d6303c9da9
commit
4a42c97f4d
Notes:
github-actions[bot]
2024-08-12 16:21:57 +00:00
Author: https://github.com/GasimGasimzada
Commit: 4a42c97f4d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1014
Reviewed-by: https://github.com/tcl3 ✅
6 changed files with 87 additions and 1 deletions
|
@ -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))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue