1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:37:45 +00:00

LibWeb: Add basic constructor/prototype to exotic objects

This commit is contained in:
Igor Pissolati 2022-04-05 17:54:04 -03:00 committed by Andreas Kling
parent 1d080e1cda
commit a387b822a0
14 changed files with 307 additions and 3 deletions

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibJS/Runtime/NativeFunction.h>
namespace Web::Bindings {
class LocationConstructor : public JS::NativeFunction {
JS_OBJECT(LocationConstructor, JS::NativeFunction);
public:
explicit LocationConstructor(JS::GlobalObject&);
virtual void initialize(JS::GlobalObject&) override;
virtual ~LocationConstructor() override;
virtual JS::ThrowCompletionOr<JS::Value> call() override;
virtual JS::ThrowCompletionOr<JS::Object*> construct(JS::FunctionObject& new_target) override;
private:
virtual bool has_constructor() const override { return true; }
};
}