summaryrefslogtreecommitdiff
path: root/Userland/DevTools/HackStudio
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-07-06 01:15:50 +0300
committerLinus Groh <mail@linusgroh.de>2021-07-06 14:20:30 +0100
commite3ef2411086488ebdb8d193bcefd06cd77372d09 (patch)
tree6323321e9e8105be9d1278dbd03992876beafeaa /Userland/DevTools/HackStudio
parent53f70e520889a58a75e243cb93ed14f08416cf8a (diff)
downloadserenity-e3ef2411086488ebdb8d193bcefd06cd77372d09.zip
LibJS: Remove the non-standard put helper and replace it's usages
This removes all usages of the non-standard put helper method and replaces all of it's usages with the specification required alternative or with define_direct_property where appropriate.
Diffstat (limited to 'Userland/DevTools/HackStudio')
-rw-r--r--Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.cpp3
-rw-r--r--Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.cpp5
-rw-r--r--Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.h2
3 files changed, 2 insertions, 8 deletions
diff --git a/Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.cpp b/Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.cpp
index 0223993c7b..3433af62e8 100644
--- a/Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.cpp
+++ b/Userland/DevTools/HackStudio/Debugger/DebuggerGlobalJSObject.cpp
@@ -89,9 +89,8 @@ Optional<JS::Value> DebuggerGlobalJSObject::debugger_to_js(const Debug::DebugInf
auto member_value = debugger_to_js(member);
if (!member_value.has_value())
continue;
- object->put(member.name, member_value.value(), {});
+ object->define_direct_property(member.name, member_value.value(), JS::default_attributes);
}
- object->finish_writing_properties();
return JS::Value(object);
}
diff --git a/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.cpp b/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.cpp
index fa3a1e7d17..02008e0397 100644
--- a/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.cpp
+++ b/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.cpp
@@ -29,11 +29,8 @@ DebuggerVariableJSObject::~DebuggerVariableJSObject()
{
}
-bool DebuggerVariableJSObject::internal_set(const JS::PropertyName& property_name, JS::Value value, JS::Value receiver)
+bool DebuggerVariableJSObject::internal_set(const JS::PropertyName& property_name, JS::Value value, JS::Value)
{
- if (m_is_writing_properties)
- return Base::internal_set(property_name, value, receiver);
-
if (!property_name.is_string()) {
vm().throw_exception<JS::TypeError>(global_object(), String::formatted("Invalid variable name {}", property_name.to_string()));
return false;
diff --git a/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.h b/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.h
index 61f5e06fd2..39c54fc7d3 100644
--- a/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.h
+++ b/Userland/DevTools/HackStudio/Debugger/DebuggerVariableJSObject.h
@@ -25,13 +25,11 @@ public:
virtual const char* class_name() const override { return m_variable_info.type_name.characters(); }
bool internal_set(JS::PropertyName const&, JS::Value value, JS::Value receiver) override;
- void finish_writing_properties() { m_is_writing_properties = false; }
private:
DebuggerGlobalJSObject& debugger_object() const;
const Debug::DebugInfo::VariableInfo& m_variable_info;
- bool m_is_writing_properties { true };
};
}