From 909f430612df8efab42838e7e172986eec719f18 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Fri, 4 Dec 2020 21:14:43 +0000 Subject: [PATCH] LibJS: Move is_script_function() to Object Every Object should be able to tell us if it is a ScriptFunction, not only Function objects! --- Libraries/LibJS/Runtime/Function.h | 2 -- Libraries/LibJS/Runtime/Object.h | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Libraries/LibJS/Runtime/Function.h b/Libraries/LibJS/Runtime/Function.h index 13bd3f5ccb..d54f059ec2 100644 --- a/Libraries/LibJS/Runtime/Function.h +++ b/Libraries/LibJS/Runtime/Function.h @@ -50,8 +50,6 @@ public: virtual void visit_edges(Visitor&) override; - virtual bool is_script_function() const { return false; } - BoundFunction* bind(Value bound_this_value, Vector arguments); Value bound_this() const { return m_bound_this; } diff --git a/Libraries/LibJS/Runtime/Object.h b/Libraries/LibJS/Runtime/Object.h index 2e37b50dc4..5486cc938f 100644 --- a/Libraries/LibJS/Runtime/Object.h +++ b/Libraries/LibJS/Runtime/Object.h @@ -117,6 +117,7 @@ public: virtual bool is_error() const { return false; } virtual bool is_function() const { return false; } virtual bool is_native_function() const { return false; } + virtual bool is_script_function() const { return false; } virtual bool is_bound_function() const { return false; } virtual bool is_proxy_object() const { return false; } virtual bool is_regexp_object() const { return false; }