mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:07:35 +00:00
LibJS: Start implementing iterable framework, add ArrayIterator
With the addition of symbol keys, work can now be done on starting to implement the well-known symbol functionality. The most important of these well-known symbols is by far Symbol.iterator. This patch adds IteratorPrototype, as well as ArrayIterator and ArrayIteratorPrototype. In the future, sometime after StringIterator has also been added, this will allow us to use Symbol.iterator directly in for..of loops, enabling the use of custom iterator objects. Also makes adding iterator support to native objects much easier (as will have to be done for Map and Set, when they get added).
This commit is contained in:
parent
51bfc6c6b3
commit
2ea85355fe
18 changed files with 657 additions and 1 deletions
|
@ -123,6 +123,7 @@ public:
|
|||
virtual bool is_number_object() const { return false; }
|
||||
virtual bool is_symbol_object() const { return false; }
|
||||
virtual bool is_bigint_object() const { return false; }
|
||||
virtual bool is_array_iterator_object() const { return false; }
|
||||
|
||||
virtual const char* class_name() const override { return "Object"; }
|
||||
virtual void visit_children(Cell::Visitor&) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue