mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
LibJS: Add a global "Object" constructor
This patch adds an "Object" constructor to the global object. The only function it implements so far is Object.getPrototypeOf().
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/MathObject.h>
|
||||
#include <LibJS/Runtime/NativeFunction.h>
|
||||
#include <LibJS/Runtime/ObjectConstructor.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
||||
namespace JS {
|
||||
@@ -24,6 +25,7 @@ GlobalObject::GlobalObject()
|
||||
return Value(arguments[0].to_number().is_nan());
|
||||
});
|
||||
put("Math", heap().allocate<MathObject>());
|
||||
put("Object", heap().allocate<ObjectConstructor>());
|
||||
}
|
||||
|
||||
GlobalObject::~GlobalObject()
|
||||
|
||||
Reference in New Issue
Block a user