1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 09:17:34 +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:
Andreas Kling 2020-03-28 17:23:54 +01:00
parent a3d92b1210
commit 14047ca432
9 changed files with 134 additions and 3 deletions

View file

@ -31,13 +31,16 @@
namespace JS {
class NativeFunction final : public Function {
class NativeFunction : public Function {
public:
explicit NativeFunction(AK::Function<Value(Object*, const Vector<Value>&)>);
virtual ~NativeFunction() override;
virtual Value call(Interpreter&, const Vector<Value>&) override;
protected:
NativeFunction() {}
private:
virtual bool is_native_function() const override { return true; }
virtual const char* class_name() const override { return "NativeFunction"; }