summaryrefslogtreecommitdiff
path: root/Libraries/LibJS
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-06-20 22:19:29 +0200
committerAndreas Kling <kling@serenityos.org>2020-06-21 00:58:55 +0200
commit94fdf4fa5a83c332b1adccb70311d47c9a4601d0 (patch)
treebf9cdf74c31ad254d91ed89861620886115c884f /Libraries/LibJS
parent1ffffa005314c073656b8aa6e70104a1b81114ea (diff)
downloadserenity-94fdf4fa5a83c332b1adccb70311d47c9a4601d0.zip
LibWeb+LibJS: Add a naive way to check if a wrapper "is" a certain type
Instead of only checking the class_name(), we now generate an is_foo() virtual in the wrapper generator. (It's currently something we override on Bindings::Wrapper, which is not really scalable.) Longer term we'll need to think up something smarter for verifying that one wrapper "is" another type of wrapper.
Diffstat (limited to 'Libraries/LibJS')
-rw-r--r--Libraries/LibJS/Runtime/Object.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibJS/Runtime/Object.h b/Libraries/LibJS/Runtime/Object.h
index 6bd5104127..ebb40cb310 100644
--- a/Libraries/LibJS/Runtime/Object.h
+++ b/Libraries/LibJS/Runtime/Object.h
@@ -111,6 +111,8 @@ public:
virtual bool is_symbol_object() const { return false; }
virtual bool is_bigint_object() const { return false; }
+ virtual bool is_web_wrapper() const { return false; }
+
virtual const char* class_name() const override { return "Object"; }
virtual void visit_children(Cell::Visitor&) override;