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:
parent
cbcf317e76
commit
fca08bd000
40 changed files with 131 additions and 101 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue