mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
LibJS: Fix build (GlobalObject::add_constructor not visible in LibWeb)
This commit is contained in:
parent
99be27b4a1
commit
c00ff4ba62
2 changed files with 10 additions and 9 deletions
|
@ -57,15 +57,6 @@
|
||||||
|
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
template<typename ConstructorType>
|
|
||||||
void GlobalObject::add_constructor(const FlyString& property_name, ConstructorType*& constructor, Object& prototype)
|
|
||||||
{
|
|
||||||
constructor = heap().allocate<ConstructorType>();
|
|
||||||
constructor->put("name", js_string(heap(), property_name), Attribute::Configurable);
|
|
||||||
prototype.put("constructor", constructor);
|
|
||||||
put(property_name, constructor, Attribute::Writable | Attribute::Configurable);
|
|
||||||
}
|
|
||||||
|
|
||||||
GlobalObject::GlobalObject()
|
GlobalObject::GlobalObject()
|
||||||
: Object(nullptr)
|
: Object(nullptr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <LibJS/Heap/Heap.h>
|
||||||
#include <LibJS/Runtime/Object.h>
|
#include <LibJS/Runtime/Object.h>
|
||||||
|
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
@ -67,4 +68,13 @@ private:
|
||||||
#undef __JS_ENUMERATE
|
#undef __JS_ENUMERATE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename ConstructorType>
|
||||||
|
inline void GlobalObject::add_constructor(const FlyString& property_name, ConstructorType*& constructor, Object& prototype)
|
||||||
|
{
|
||||||
|
constructor = heap().allocate<ConstructorType>();
|
||||||
|
constructor->put("name", js_string(heap(), property_name), Attribute::Configurable);
|
||||||
|
prototype.put("constructor", constructor);
|
||||||
|
put(property_name, constructor, Attribute::Writable | Attribute::Configurable);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue