summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/ErrorConstructor.h
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-06-11 17:54:42 +0100
committerLinus Groh <mail@linusgroh.de>2021-06-11 18:49:50 +0100
commitad3242bab785f7cdb1d44bb9a043ad5c646306ae (patch)
tree2363ae9ac4bafbcfde7e2b58a528b93f76db249a /Userland/Libraries/LibJS/Runtime/ErrorConstructor.h
parent0e10dec324e30ca138cc8b7b3f37c50075d0a3a0 (diff)
downloadserenity-ad3242bab785f7cdb1d44bb9a043ad5c646306ae.zip
LibJS: Rename JS_ENUMERATE_{ERROR_SUBCLASSES => NATIVE_ERRORS}
The fact that they *are* subclasses is an implementation detail and should not be highlighted. The spec calls these NativeErrors, so let's use that. Also added a comment explaining *why* they inherit from Error - I was about to change that :^)
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/ErrorConstructor.h')
-rw-r--r--Userland/Libraries/LibJS/Runtime/ErrorConstructor.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.h b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.h
index a3a5c19cb5..71fd400b6f 100644
--- a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.h
+++ b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.h
@@ -26,24 +26,24 @@ private:
virtual bool has_constructor() const override { return true; }
};
-#define DECLARE_ERROR_SUBCLASS_CONSTRUCTOR(ClassName, snake_name, PrototypeName, ConstructorName) \
- class ConstructorName final : public NativeFunction { \
- JS_OBJECT(ConstructorName, NativeFunction); \
- \
- public: \
- explicit ConstructorName(GlobalObject&); \
- virtual void initialize(GlobalObject&) override; \
- virtual ~ConstructorName() override; \
- virtual Value call() override; \
- virtual Value construct(Function& new_target) override; \
- \
- private: \
- virtual bool has_constructor() const override { return true; } \
+#define DECLARE_NATIVE_ERROR_CONSTRUCTOR(ClassName, snake_name, PrototypeName, ConstructorName) \
+ class ConstructorName final : public NativeFunction { \
+ JS_OBJECT(ConstructorName, NativeFunction); \
+ \
+ public: \
+ explicit ConstructorName(GlobalObject&); \
+ virtual void initialize(GlobalObject&) override; \
+ virtual ~ConstructorName() override; \
+ virtual Value call() override; \
+ virtual Value construct(Function& new_target) override; \
+ \
+ private: \
+ virtual bool has_constructor() const override { return true; } \
};
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \
- DECLARE_ERROR_SUBCLASS_CONSTRUCTOR(ClassName, snake_name, PrototypeName, ConstructorName)
-JS_ENUMERATE_ERROR_SUBCLASSES
+ DECLARE_NATIVE_ERROR_CONSTRUCTOR(ClassName, snake_name, PrototypeName, ConstructorName)
+JS_ENUMERATE_NATIVE_ERRORS
#undef __JS_ENUMERATE
}