mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibJS: Add FunctionObject::fast_is<BoundFunction>()
This commit is contained in:
parent
e1e7007707
commit
aec20e032b
|
|
@ -36,9 +36,14 @@ private:
|
|||
ThrowCompletionOr<void> get_stack_frame_size(size_t& registers_and_constants_and_locals_count, size_t& argument_count) override;
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
virtual bool is_bound_function() const final { return true; }
|
||||
|
||||
GC::Ptr<FunctionObject> m_bound_target_function; // [[BoundTargetFunction]]
|
||||
Value m_bound_this; // [[BoundThis]]
|
||||
Vector<Value> m_bound_arguments; // [[BoundArguments]]
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool FunctionObject::fast_is<BoundFunction>() const { return is_bound_function(); }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@ public:
|
|||
|
||||
virtual FunctionParameters const& formal_parameters() const { VERIFY_NOT_REACHED(); }
|
||||
|
||||
template<typename T>
|
||||
bool fast_is() const = delete;
|
||||
|
||||
protected:
|
||||
explicit FunctionObject(Realm&, Object* prototype, MayInterfereWithIndexedPropertyAccess = MayInterfereWithIndexedPropertyAccess::No);
|
||||
explicit FunctionObject(Object& prototype, MayInterfereWithIndexedPropertyAccess = MayInterfereWithIndexedPropertyAccess::No);
|
||||
|
|
@ -50,6 +53,7 @@ protected:
|
|||
|
||||
private:
|
||||
virtual bool is_function() const override { return true; }
|
||||
virtual bool is_bound_function() const { return false; }
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user