/* * Copyright (c) 2022, David Tuin * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace JS { class ModuleNamespaceObject final : public Object { JS_OBJECT(ModuleNamespaceObject, Object); public: ModuleNamespaceObject(Realm&, Module* module, Vector exports); // 10.4.6 Module Namespace Exotic Objects, https://tc39.es/ecma262/#sec-module-namespace-exotic-objects virtual ThrowCompletionOr internal_get_prototype_of() const override; virtual ThrowCompletionOr internal_set_prototype_of(Object* prototype) override; virtual ThrowCompletionOr internal_is_extensible() const override; virtual ThrowCompletionOr internal_prevent_extensions() override; virtual ThrowCompletionOr> internal_get_own_property(PropertyKey const&) const override; virtual ThrowCompletionOr internal_define_own_property(PropertyKey const&, PropertyDescriptor const&) override; virtual ThrowCompletionOr internal_has_property(PropertyKey const&) const override; virtual ThrowCompletionOr internal_get(PropertyKey const&, Value receiver) const override; virtual ThrowCompletionOr internal_set(PropertyKey const&, Value value, Value receiver) override; virtual ThrowCompletionOr internal_delete(PropertyKey const&) override; virtual ThrowCompletionOr> internal_own_property_keys() const override; virtual void initialize(Realm&) override; private: // FIXME: UHHH how do we want to store this to avoid cycles but be safe?? Module* m_module; // [[Module]] Vector m_exports; // [[Exports]] }; }