1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:38:10 +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,15 +28,16 @@
#include <LibJS/Interpreter.h>
#include <LibJS/Runtime/Date.h>
#include <LibJS/Runtime/DateConstructor.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <sys/time.h>
#include <time.h>
namespace JS {
DateConstructor::DateConstructor()
: NativeFunction("Date", *interpreter().function_prototype())
: NativeFunction("Date", *interpreter().global_object().function_prototype())
{
put("prototype", interpreter().date_prototype());
put("prototype", interpreter().global_object().date_prototype());
put("length", Value(7));
put_native_function("now", now);