mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 12:15:07 +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
|
@ -27,13 +27,14 @@
|
|||
#include <AK/FlyString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <LibJS/Interpreter.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/MathObject.h>
|
||||
#include <math.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
MathObject::MathObject()
|
||||
: Object(interpreter().object_prototype())
|
||||
: Object(interpreter().global_object().object_prototype())
|
||||
{
|
||||
put_native_function("abs", abs, 1);
|
||||
put_native_function("random", random);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue