2021-04-12 22:59:15 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2021, Matthew Olsson <matthewcolsson@gmail.com>
|
|
|
|
|
* Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
|
2022-02-15 17:28:01 -03:00
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
2021-04-12 22:59:15 -03:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "DebuggerGlobalJSObject.h"
|
2022-03-16 21:26:49 -03:00
|
|
|
#include <AK/StringView.h>
|
2021-04-12 22:59:15 -03:00
|
|
|
#include <LibDebug/DebugInfo.h>
|
2021-09-29 14:31:37 -03:00
|
|
|
#include <LibJS/Runtime/Completion.h>
|
2021-04-12 22:59:15 -03:00
|
|
|
#include <LibJS/Runtime/Object.h>
|
|
|
|
|
|
|
|
|
|
namespace HackStudio {
|
|
|
|
|
|
|
|
|
|
class DebuggerVariableJSObject final : public JS::Object {
|
2021-04-20 19:59:53 -03:00
|
|
|
using Base = JS::Object;
|
2021-04-12 22:59:15 -03:00
|
|
|
|
|
|
|
|
public:
|
2022-04-01 14:58:27 -03:00
|
|
|
static DebuggerVariableJSObject* create(DebuggerGlobalJSObject&, Debug::DebugInfo::VariableInfo const& variable_info);
|
2021-04-12 22:59:15 -03:00
|
|
|
|
2022-04-01 14:58:27 -03:00
|
|
|
DebuggerVariableJSObject(Debug::DebugInfo::VariableInfo const& variable_info, JS::Object& prototype);
|
2022-02-15 17:28:01 -03:00
|
|
|
virtual ~DebuggerVariableJSObject() override = default;
|
2021-04-12 22:59:15 -03:00
|
|
|
|
2022-03-16 21:26:49 -03:00
|
|
|
virtual StringView class_name() const override { return m_variable_info.type_name; }
|
2021-04-20 19:59:53 -03:00
|
|
|
|
2021-10-24 11:01:24 -03:00
|
|
|
JS::ThrowCompletionOr<bool> internal_set(JS::PropertyKey const&, JS::Value value, JS::Value receiver) override;
|
2021-04-12 22:59:15 -03:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
DebuggerGlobalJSObject& debugger_object() const;
|
|
|
|
|
|
2022-04-01 14:58:27 -03:00
|
|
|
Debug::DebugInfo::VariableInfo const& m_variable_info;
|
2021-04-12 22:59:15 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|