ConsoleGlobalObject.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibJS/Forward.h>
  8. #include <LibJS/Runtime/Completion.h>
  9. #include <LibJS/Runtime/GlobalObject.h>
  10. namespace Web::Bindings {
  11. class WindowObject;
  12. }
  13. namespace WebContent {
  14. class ConsoleGlobalObject final : public JS::GlobalObject {
  15. JS_OBJECT(ConsoleGlobalObject, JS::GlobalObject);
  16. public:
  17. ConsoleGlobalObject(Web::Bindings::WindowObject&);
  18. virtual ~ConsoleGlobalObject() override;
  19. virtual JS::ThrowCompletionOr<Object*> internal_get_prototype_of() const override;
  20. virtual bool internal_set_prototype_of(Object* prototype) override;
  21. virtual bool internal_is_extensible() const override;
  22. virtual bool internal_prevent_extensions() override;
  23. virtual Optional<JS::PropertyDescriptor> internal_get_own_property(JS::PropertyName const& name) const override;
  24. virtual bool internal_define_own_property(JS::PropertyName const& name, JS::PropertyDescriptor const& descriptor) override;
  25. virtual bool internal_has_property(JS::PropertyName const& name) const override;
  26. virtual JS::Value internal_get(JS::PropertyName const&, JS::Value) const override;
  27. virtual bool internal_set(JS::PropertyName const&, JS::Value value, JS::Value receiver) override;
  28. virtual bool internal_delete(JS::PropertyName const& name) override;
  29. virtual JS::MarkedValueList internal_own_property_keys() const override;
  30. virtual void initialize_global_object() override;
  31. private:
  32. virtual void visit_edges(Visitor&) override;
  33. // Because $0 is not a nice C++ function name
  34. JS_DECLARE_NATIVE_GETTER(inspected_node_getter);
  35. Web::Bindings::WindowObject* m_window_object;
  36. };
  37. }