File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ class JS_API Map : public Object {
2525
2626 virtual ~Map () override = default ;
2727
28+ virtual bool is_map_object () const final { return true ; }
29+
2830 void map_clear ();
2931 bool map_remove (Value const &);
3032 Optional<Value> map_get (Value const &) const ;
@@ -116,4 +118,7 @@ class JS_API Map : public Object {
116118 HashMap<Value, Value, ValueTraits> m_entries;
117119};
118120
121+ template <>
122+ inline bool Object::fast_is<Map>() const { return is_map_object (); }
123+
119124}
Original file line number Diff line number Diff line change @@ -227,6 +227,8 @@ class JS_API Object : public Cell
227227 virtual bool is_ecmascript_function_object () const { return false ; }
228228 virtual bool is_array_iterator () const { return false ; }
229229 virtual bool is_raw_json_object () const { return false ; }
230+ virtual bool is_set_object () const { return false ; }
231+ virtual bool is_map_object () const { return false ; }
230232
231233 virtual bool eligible_for_own_property_enumeration_fast_path () const { return true ; }
232234
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ class JS_API Set : public Object {
2424 virtual void initialize (Realm&) override ;
2525 virtual ~Set () override = default ;
2626
27+ virtual bool is_set_object () const final { return true ; }
28+
2729 // NOTE: Unlike what the spec says, we implement Sets using an underlying map,
2830 // so all the functions below do not directly implement the operations as
2931 // defined by the specification.
@@ -59,4 +61,7 @@ struct SetRecord {
5961ThrowCompletionOr<SetRecord> get_set_record (VM&, Value);
6062bool set_data_has (GC::Ref<Set>, Value);
6163
64+ template <>
65+ inline bool Object::fast_is<Set>() const { return is_set_object (); }
66+
6267}
You can’t perform that action at this time.
0 commit comments