mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 03:18:11 +00:00
LibJS: Change ThrowableStringBuilder to privately inherit StringBuilder
Not an issue currently, but while developing, it's easy to miss cases where an infallible AK::StringBuilder method is still used. By making this inheritance private, and explicitly pulling in base methods we can safely use, we get extra help from the compiler to indicate such mistakes immediately.
This commit is contained in:
parent
4eebe753d1
commit
7163e4d456
1 changed files with 5 additions and 1 deletions
|
@ -15,7 +15,7 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
class ThrowableStringBuilder : public AK::StringBuilder {
|
||||
class ThrowableStringBuilder : private AK::StringBuilder {
|
||||
public:
|
||||
explicit ThrowableStringBuilder(VM&);
|
||||
|
||||
|
@ -25,6 +25,10 @@ public:
|
|||
ThrowCompletionOr<void> append_code_point(u32 value);
|
||||
ThrowCompletionOr<String> to_string() const;
|
||||
|
||||
using AK::StringBuilder::is_empty;
|
||||
using AK::StringBuilder::string_view;
|
||||
using AK::StringBuilder::trim;
|
||||
|
||||
private:
|
||||
VM& m_vm;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue