mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 15:07:45 +00:00
LibJS: Hide all the constructors!
Now that the GC allocator is able to invoke Cell subclass constructors directly via friendship, we no longer need to keep them public. :^)
This commit is contained in:
parent
d54ba587f3
commit
35c9aa7c05
196 changed files with 456 additions and 242 deletions
|
@ -15,7 +15,6 @@ class ErrorConstructor final : public NativeFunction {
|
|||
JS_OBJECT(ErrorConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit ErrorConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ErrorConstructor() override = default;
|
||||
|
||||
|
@ -23,6 +22,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit ErrorConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
};
|
||||
|
||||
|
@ -31,14 +32,18 @@ private:
|
|||
JS_OBJECT(ConstructorName, NativeFunction); \
|
||||
\
|
||||
public: \
|
||||
explicit ConstructorName(Realm&); \
|
||||
virtual void initialize(Realm&) override; \
|
||||
virtual ~ConstructorName() override; \
|
||||
virtual ThrowCompletionOr<Value> call() override; \
|
||||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override; \
|
||||
\
|
||||
private: \
|
||||
virtual bool has_constructor() const override { return true; } \
|
||||
explicit ConstructorName(Realm&); \
|
||||
\
|
||||
virtual bool has_constructor() const override \
|
||||
{ \
|
||||
return true; \
|
||||
} \
|
||||
};
|
||||
|
||||
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue