2021-03-20 05:22:27 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-03-20 05:22:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2022-03-16 18:26:49 -06:00
|
|
|
#include <AK/StringView.h>
|
2021-03-20 05:22:27 +00:00
|
|
|
#include <LibJS/Runtime/NativeFunction.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::Bindings {
|
|
|
|
|
|
|
|
|
|
class ImageConstructor final : public JS::NativeFunction {
|
2024-04-06 10:16:04 -07:00
|
|
|
JS_OBJECT(ImageConstructor, JS::NativeFunction);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DECLARE_ALLOCATOR(ImageConstructor);
|
2024-04-06 10:16:04 -07:00
|
|
|
|
2021-03-20 05:22:27 +00:00
|
|
|
public:
|
2022-08-16 00:20:49 +01:00
|
|
|
explicit ImageConstructor(JS::Realm&);
|
2023-08-07 08:41:28 +02:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2022-03-14 13:21:51 -06:00
|
|
|
virtual ~ImageConstructor() override = default;
|
2021-03-20 05:22:27 +00:00
|
|
|
|
2021-10-20 21:16:30 +01:00
|
|
|
virtual JS::ThrowCompletionOr<JS::Value> call() override;
|
2024-11-15 04:01:23 +13:00
|
|
|
virtual JS::ThrowCompletionOr<GC::Ref<JS::Object>> construct(JS::FunctionObject& new_target) override;
|
2021-03-20 05:22:27 +00:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
virtual bool has_constructor() const override { return true; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|