mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +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:
@@ -29,15 +29,16 @@
|
||||
#include <LibJS/Interpreter.h>
|
||||
#include <LibJS/Runtime/Array.h>
|
||||
#include <LibJS/Runtime/Error.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/ObjectConstructor.h>
|
||||
#include <LibJS/Runtime/Shape.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
ObjectConstructor::ObjectConstructor()
|
||||
: NativeFunction("Object", *interpreter().function_prototype())
|
||||
: NativeFunction("Object", *interpreter().global_object().function_prototype())
|
||||
{
|
||||
put("prototype", interpreter().object_prototype());
|
||||
put("prototype", interpreter().global_object().object_prototype());
|
||||
|
||||
put_native_function("defineProperty", define_property, 3);
|
||||
put_native_function("getOwnPropertyDescriptor", get_own_property_descriptor, 2);
|
||||
|
||||
Reference in New Issue
Block a user