1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:37:35 +00:00

LibJS: Use RTTI for inheritance checks

This replaces the hand-rolled string-based inheritance check tech.
This commit is contained in:
Andreas Kling 2021-01-01 17:00:20 +01:00
parent fc86717f43
commit 8333055c3d
3 changed files with 7 additions and 10 deletions

View file

@ -39,11 +39,10 @@
namespace JS {
#define JS_OBJECT(class_, base_class) \
public: \
using Base = base_class; \
virtual const char* class_name() const override { return #class_; } \
virtual bool inherits(const StringView& class_name) const override { return class_name == #class_ || Base::inherits(class_name); }
#define JS_OBJECT(class_, base_class) \
public: \
using Base = base_class; \
virtual const char* class_name() const override { return #class_; }
struct PropertyDescriptor {
PropertyAttributes attributes;
@ -67,8 +66,6 @@ public:
virtual void initialize(GlobalObject&) override;
virtual ~Object();
virtual bool inherits(const StringView& class_name) const { return class_name == this->class_name(); }
enum class PropertyKind {
Key,
Value,