DebuggerVariableJSObject.h 1.1 KB

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