From 317cf65eb0e4c60419fe24f8bb3bb71c9318babc Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sat, 26 Apr 2025 08:07:22 -0400 Subject: [PATCH] LibJS: Avoid naming conflict between Object's and Error's is_error Object defines an is_error virtual method to be overridden by Error for fast-is. This is the same name as the Error.isError constructor method. Rename the former to avoid conflicts, as GCC 15 just started warning on this. --- Libraries/LibJS/Runtime/Error.h | 4 ++-- Libraries/LibJS/Runtime/Object.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/LibJS/Runtime/Error.h b/Libraries/LibJS/Runtime/Error.h index 3632a83c936..6669236fe74 100644 --- a/Libraries/LibJS/Runtime/Error.h +++ b/Libraries/LibJS/Runtime/Error.h @@ -47,14 +47,14 @@ protected: explicit Error(Object& prototype); private: - virtual bool is_error() const final { return true; } + virtual bool is_error_object() const final { return true; } void populate_stack(); Vector m_traceback; }; template<> -inline bool Object::fast_is() const { return is_error(); } +inline bool Object::fast_is() const { return is_error_object(); } // NOTE: Making these inherit from Error is not required by the spec but // our way of implementing the [[ErrorData]] internal slot, which is diff --git a/Libraries/LibJS/Runtime/Object.h b/Libraries/LibJS/Runtime/Object.h index e4e769173fc..8e7e1bbf129 100644 --- a/Libraries/LibJS/Runtime/Object.h +++ b/Libraries/LibJS/Runtime/Object.h @@ -197,7 +197,7 @@ public: virtual bool is_function() const { return false; } virtual bool is_promise() const { return false; } - virtual bool is_error() const { return false; } + virtual bool is_error_object() const { return false; } virtual bool is_date() const { return false; } virtual bool is_number_object() const { return false; } virtual bool is_boolean_object() const { return false; }