mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 09:06:08 +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
Notes:
sideshowbarker
2024-07-17 17:08:50 +09:00
Author: https://github.com/ldm5180
Commit: a0367aa43b
Pull-request: https://github.com/SerenityOS/serenity/pull/13084
Reviewed-by: https://github.com/linusg
Reviewed-by: https://github.com/tomuta
17 changed files with 37 additions and 20 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/StringView.h>
|
||||
#include <LibJS/Runtime/Completion.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
|
||||
|
@ -19,7 +20,7 @@ struct Variable {
|
|||
#define JS_ENVIRONMENT(class_, base_class) \
|
||||
public: \
|
||||
using Base = base_class; \
|
||||
virtual char const* class_name() const override { return #class_; }
|
||||
virtual StringView class_name() const override { return #class_; }
|
||||
|
||||
class Environment : public Cell {
|
||||
public:
|
||||
|
@ -47,7 +48,7 @@ public:
|
|||
template<typename T>
|
||||
bool fast_is() const = delete;
|
||||
|
||||
virtual char const* class_name() const override { return "Environment"; }
|
||||
virtual StringView class_name() const override { return "Environment"sv; }
|
||||
|
||||
// This flag is set on the entire variable environment chain when direct eval() is performed.
|
||||
// It is used to disable non-local variable access caching.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue