1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 23:25:08 +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

@ -29,6 +29,7 @@
#include <AK/Function.h>
#include <LibJS/Interpreter.h>
#include <LibJS/Runtime/ConsoleObject.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <stdio.h>
namespace JS {
@ -44,7 +45,7 @@ static void print_args(Interpreter& interpreter)
}
ConsoleObject::ConsoleObject()
: Object(interpreter().object_prototype())
: Object(interpreter().global_object().object_prototype())
{
put_native_function("log", log);
put_native_function("debug", debug);