1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

LibJS: Move builtin prototypes to the global object

This moves us towards being able to run JavaScript in different global
objects without allocating a separate GC heap.
This commit is contained in:
Andreas Kling 2020-04-18 13:18:06 +02:00
parent cbcf317e76
commit fca08bd000
40 changed files with 131 additions and 101 deletions

View file

@ -28,6 +28,7 @@
#include <AK/Function.h>
#include <LibJS/Interpreter.h>
#include <LibJS/Runtime/Error.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/PrimitiveString.h>
#include <LibJS/Runtime/Value.h>
#include <LibWeb/Bindings/CanvasRenderingContext2DWrapper.h>
@ -44,7 +45,7 @@ CanvasRenderingContext2DWrapper* wrap(JS::Heap& heap, CanvasRenderingContext2D&
}
CanvasRenderingContext2DWrapper::CanvasRenderingContext2DWrapper(CanvasRenderingContext2D& impl)
: Wrapper(*interpreter().object_prototype())
: Wrapper(*interpreter().global_object().object_prototype())
, m_impl(impl)
{
put_native_property("fillStyle", fill_style_getter, fill_style_setter);