DebuggerVariableJSObject.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2021, Matthew Olsson <matthewcolsson@gmail.com>
  3. * Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
  4. * Copyright (c) 2022, the SerenityOS developers.
  5. *
  6. * SPDX-License-Identifier: BSD-2-Clause
  7. */
  8. #pragma once
  9. #include "DebuggerGlobalJSObject.h"
  10. #include <AK/StringView.h>
  11. #include <LibDebug/DebugInfo.h>
  12. #include <LibJS/Runtime/Completion.h>
  13. #include <LibJS/Runtime/Object.h>
  14. namespace HackStudio {
  15. class DebuggerVariableJSObject final : public JS::Object {
  16. using Base = JS::Object;
  17. public:
  18. static DebuggerVariableJSObject* create(DebuggerGlobalJSObject&, const Debug::DebugInfo::VariableInfo& variable_info);
  19. DebuggerVariableJSObject(const Debug::DebugInfo::VariableInfo& variable_info, JS::Object& prototype);
  20. virtual ~DebuggerVariableJSObject() override = default;
  21. virtual StringView class_name() const override { return m_variable_info.type_name; }
  22. JS::ThrowCompletionOr<bool> internal_set(JS::PropertyKey const&, JS::Value value, JS::Value receiver) override;
  23. private:
  24. DebuggerGlobalJSObject& debugger_object() const;
  25. const Debug::DebugInfo::VariableInfo& m_variable_info;
  26. };
  27. }