summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/BooleanObject.h
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-12-10 22:50:02 +0000
committerLinus Groh <mail@linusgroh.de>2021-12-10 22:52:36 +0000
commit038d354b5df4e74547fd7d37f334e5e90ddbe04b (patch)
tree5a0da716147664cd3c6b21d831cfaab218a8092c /Userland/Libraries/LibJS/Runtime/BooleanObject.h
parent07c5419a823cdf7be394c4c96088293e53c4ed32 (diff)
downloadserenity-038d354b5df4e74547fd7d37f334e5e90ddbe04b.zip
LibJS: Remove Object::value_of()
Being really close to Object.prototype.valueOf() name wise makes this unnecessarily confusing - while it sometimes serves as the implementation of a valueOf() function, it's an abstraction which the spec doesn't have. Use the appropriate getters to retrieve specific internal slots instead, most commonly [[FooData]] from the primitive wrapper objects. For the Object class specifically, use the Value(Object*) ctor instead.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/BooleanObject.h')
-rw-r--r--Userland/Libraries/LibJS/Runtime/BooleanObject.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/BooleanObject.h b/Userland/Libraries/LibJS/Runtime/BooleanObject.h
index a99556865c..27fc816648 100644
--- a/Userland/Libraries/LibJS/Runtime/BooleanObject.h
+++ b/Userland/Libraries/LibJS/Runtime/BooleanObject.h
@@ -18,10 +18,7 @@ public:
BooleanObject(bool, Object& prototype);
virtual ~BooleanObject() override;
- virtual Value value_of() const override
- {
- return Value(m_value);
- }
+ bool boolean() const { return m_value; }
private:
bool m_value { false };