summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/PrimitiveString.h
diff options
context:
space:
mode:
authorLenny Maiorani <lenny@serenityos.org>2022-03-16 18:26:49 -0600
committerLinus Groh <mail@linusgroh.de>2022-03-19 00:20:46 +0000
commita0367aa43b89b9714a86475407aef5702ae9e79d (patch)
tree5314c918b0698750b0ac1bab1948b370bbfdc363 /Userland/Libraries/LibJS/Runtime/PrimitiveString.h
parent5b7a5b3c01007b1ba332310ed1b669bd8b4edebc (diff)
downloadserenity-a0367aa43b89b9714a86475407aef5702ae9e79d.zip
DevTools+LibJS+LibWeb: Change class_name to use StringView
This helps make the overall codebase consistent. `class_name()` in `Kernel` is always `StringView`, but not elsewhere. Additionally, this results in the `strlen` (which needs to be done when printing or other operations) always being computed at compile-time.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/PrimitiveString.h')
-rw-r--r--Userland/Libraries/LibJS/Runtime/PrimitiveString.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/PrimitiveString.h b/Userland/Libraries/LibJS/Runtime/PrimitiveString.h
index 5eaae45562..49b136bcd6 100644
--- a/Userland/Libraries/LibJS/Runtime/PrimitiveString.h
+++ b/Userland/Libraries/LibJS/Runtime/PrimitiveString.h
@@ -7,6 +7,7 @@
#pragma once
#include <AK/String.h>
+#include <AK/StringView.h>
#include <LibJS/Forward.h>
#include <LibJS/Heap/Cell.h>
#include <LibJS/Runtime/Utf16String.h>
@@ -33,7 +34,7 @@ public:
Optional<Value> get(GlobalObject&, PropertyKey const&) const;
private:
- virtual const char* class_name() const override { return "PrimitiveString"; }
+ virtual StringView class_name() const override { return "PrimitiveString"sv; }
mutable String m_utf8_string;
mutable bool m_has_utf8_string { false };