diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-07 10:46:57 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-07 10:57:07 +0100 |
commit | 3620a6e054494223f9d5be322cf9cb23c3b465af (patch) | |
tree | 3bb64d9c88ee5eb21f88b4574063305c444d6d66 /Userland | |
parent | c95d48c8d66e05b632a71e414d0fff323c4b67bf (diff) | |
download | serenity-3620a6e054494223f9d5be322cf9cb23c3b465af.zip |
LibJS: Function must mark its home object
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Function.cpp | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Function.h | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Function.cpp b/Userland/Libraries/LibJS/Runtime/Function.cpp index 43b7d6e7e1..d054ee3a4a 100644 --- a/Userland/Libraries/LibJS/Runtime/Function.cpp +++ b/Userland/Libraries/LibJS/Runtime/Function.cpp @@ -90,6 +90,7 @@ void Function::visit_edges(Visitor& visitor) { Object::visit_edges(visitor); + visitor.visit(m_home_object); visitor.visit(m_bound_this); for (auto argument : m_bound_arguments) diff --git a/Userland/Libraries/LibJS/Runtime/Function.h b/Userland/Libraries/LibJS/Runtime/Function.h index d54f059ec2..6bd2ad7b16 100644 --- a/Userland/Libraries/LibJS/Runtime/Function.h +++ b/Userland/Libraries/LibJS/Runtime/Function.h @@ -48,8 +48,6 @@ public: virtual const FlyString& name() const = 0; virtual LexicalEnvironment* create_environment() = 0; - virtual void visit_edges(Visitor&) override; - BoundFunction* bind(Value bound_this_value, Vector<Value> arguments); Value bound_this() const { return m_bound_this; } @@ -65,6 +63,8 @@ public: virtual bool is_strict_mode() const { return false; } protected: + virtual void visit_edges(Visitor&) override; + explicit Function(Object& prototype); Function(Object& prototype, Value bound_this, Vector<Value> bound_arguments); |