mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:28:11 +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:
parent
5b7a5b3c01
commit
a0367aa43b
17 changed files with 37 additions and 20 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/StringView.h>
|
||||
#include <LibJS/Runtime/NativeFunction.h>
|
||||
#include <LibJS/Runtime/PromiseReaction.h>
|
||||
|
||||
|
@ -19,7 +20,7 @@ struct RemainingElements final : public Cell {
|
|||
{
|
||||
}
|
||||
|
||||
virtual const char* class_name() const override { return "RemainingElements"; }
|
||||
virtual StringView class_name() const override { return "RemainingElements"sv; }
|
||||
|
||||
u64 value { 0 };
|
||||
};
|
||||
|
@ -34,7 +35,7 @@ public:
|
|||
Vector<Value> const& values() const { return m_values; }
|
||||
|
||||
private:
|
||||
virtual const char* class_name() const override { return "PromiseValueList"; }
|
||||
virtual StringView class_name() const override { return "PromiseValueList"sv; }
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
Vector<Value> m_values;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue