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

LibJS: Pass prototype to Error constructors

This commit is contained in:
Andreas Kling 2020-04-17 19:31:48 +02:00
parent 0df4d2823a
commit 205ac0090d
5 changed files with 30 additions and 15 deletions

View file

@ -33,7 +33,9 @@ namespace JS {
class Error : public Object {
public:
Error(const FlyString& name, const String& message);
static Error* create(GlobalObject&, const FlyString& name, const String& message);
Error(const FlyString& name, const String& message, Object& prototype);
virtual ~Error() override;
const FlyString& name() const { return m_name; }
@ -52,7 +54,9 @@ private:
#define DECLARE_ERROR_SUBCLASS(ClassName, snake_name, PrototypeName, ConstructorName) \
class ClassName final : public Error { \
public: \
ClassName(const String& message); \
static ClassName* create(GlobalObject&, const String& message); \
\
ClassName(const String& message, Object& prototype); \
virtual ~ClassName() override; \
\
private: \