/* * Copyright (c) 2022, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include namespace Web::Bindings { // https://webidl.spec.whatwg.org/#dfn-legacy-platform-object class LegacyPlatformObject : public PlatformObject { WEB_PLATFORM_OBJECT(LegacyPlatformObject, PlatformObject); public: virtual ~LegacyPlatformObject() override; virtual JS::ThrowCompletionOr> internal_get_own_property(JS::PropertyKey const&) const override; virtual JS::ThrowCompletionOr internal_set(JS::PropertyKey const&, JS::Value, JS::Value) override; virtual JS::ThrowCompletionOr internal_define_own_property(JS::PropertyKey const&, JS::PropertyDescriptor const&) override; virtual JS::ThrowCompletionOr internal_delete(JS::PropertyKey const&) override; virtual JS::ThrowCompletionOr internal_prevent_extensions() override; virtual JS::ThrowCompletionOr> internal_own_property_keys() const override; JS::ThrowCompletionOr is_named_property_exposed_on_object(JS::PropertyKey const&) const; JS::ThrowCompletionOr> legacy_platform_object_get_own_property_for_get_own_property_slot(JS::PropertyKey const&) const; JS::ThrowCompletionOr> legacy_platform_object_get_own_property_for_set_slot(JS::PropertyKey const&) const; virtual JS::Value item_value(size_t index) const; virtual JS::Value named_item_value(FlyString const& name) const; virtual Vector supported_property_names() const; virtual bool is_supported_property_index(u32) const; protected: explicit LegacyPlatformObject(JS::Object& prototype); }; }