DebuggerVariableJSObject.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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/Object.h>
  11. namespace HackStudio {
  12. class DebuggerVariableJSObject final : public JS::Object {
  13. JS_OBJECT(DebuggerVariableJSObject, JS::Object);
  14. public:
  15. static DebuggerVariableJSObject* create(DebuggerGlobalJSObject&, const Debug::DebugInfo::VariableInfo& variable_info);
  16. DebuggerVariableJSObject(const Debug::DebugInfo::VariableInfo& variable_info, JS::Object& prototype);
  17. virtual ~DebuggerVariableJSObject() override;
  18. virtual bool put(const JS::PropertyName& name, JS::Value value, JS::Value) override;
  19. void finish_writing_properties() { m_is_writing_properties = false; }
  20. private:
  21. DebuggerGlobalJSObject& debugger_object() const;
  22. const Debug::DebugInfo::VariableInfo& m_variable_info;
  23. bool m_is_writing_properties { true };
  24. };
  25. }