2022-02-26 10:34:08 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-03-16 18:26:49 -06:00
|
|
|
#include <AK/StringView.h>
|
2022-02-26 10:34:08 +00:00
|
|
|
#include <LibJS/Runtime/NativeFunction.h>
|
|
|
|
|
|
|
|
namespace Web::Bindings {
|
|
|
|
|
|
|
|
class AudioConstructor final : public JS::NativeFunction {
|
2024-04-06 10:16:04 -07:00
|
|
|
JS_OBJECT(AudioConstructor, JS::NativeFunction);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DECLARE_ALLOCATOR(AudioConstructor);
|
2024-04-06 10:16:04 -07:00
|
|
|
|
2022-02-26 10:34:08 +00:00
|
|
|
public:
|
2022-08-16 00:20:49 +01:00
|
|
|
explicit AudioConstructor(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 ~AudioConstructor() override = default;
|
2022-02-26 10:34:08 +00: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;
|
2022-02-26 10:34:08 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
virtual bool has_constructor() const override { return true; }
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|