mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 09:15:07 +00:00

This patch introduces the Wrapper and Wrappable classes. Node now inherits from Wrappable, and can be wrapped in a GC-allocated Bindings::NodeWrapper object. The only property we expose right now is the very simple nodeName property. When a Document's JS::Interpreter is first instantiated, we add a "document" property with a DocumentWrapper object to the global object. This is pretty cool! :^)
18 lines
264 B
C++
18 lines
264 B
C++
#include <LibWeb/Bindings/Wrappable.h>
|
|
#include <LibWeb/Bindings/Wrapper.h>
|
|
|
|
namespace Web {
|
|
namespace Bindings {
|
|
|
|
Wrappable::~Wrappable()
|
|
{
|
|
}
|
|
|
|
void Wrappable::set_wrapper(Wrapper& wrapper)
|
|
{
|
|
ASSERT(!m_wrapper);
|
|
m_wrapper = wrapper.make_weak_ptr();
|
|
}
|
|
|
|
}
|
|
}
|