1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:47:46 +00:00

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.
This commit is contained in:
Lenny Maiorani 2022-03-16 18:26:49 -06:00 committed by Linus Groh
parent 5b7a5b3c01
commit a0367aa43b
17 changed files with 37 additions and 20 deletions

View file

@ -8,6 +8,7 @@
#pragma once
#include <AK/OwnPtr.h>
#include <AK/StringView.h>
#include <AK/Weakable.h>
#include <LibJS/Heap/Cell.h>
@ -35,7 +36,7 @@ public:
void set_host_defined(OwnPtr<HostDefined> host_defined) { m_host_defined = move(host_defined); }
private:
virtual char const* class_name() const override { return "Realm"; }
virtual StringView class_name() const override { return "Realm"sv; }
virtual void visit_edges(Visitor&) override;
GlobalObject* m_global_object { nullptr }; // [[GlobalObject]]