Use array based storage in container objects (#3600)
Currently, collections use object based solutions for storing elements and iterating on them. If an element is deleted and re-inserted, the storage position is the same as before so the iteration order is wrong. This patch replaces the object based storage with an array based solution that helps to store and iterate elements as expected. JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs@inf.u-szeged.hu
This commit is contained in:
@@ -2981,9 +2981,7 @@ bool jerry_object_is_valid_foreach (ecma_object_t *object_p) /**< object to test
|
||||
switch (ext_object_p->u.class_prop.class_id)
|
||||
{
|
||||
/* An object's internal property object should not be iterable by foreach. */
|
||||
case LIT_INTERNAL_MAGIC_STRING_INTERNAL_OBJECT:
|
||||
/* Containers are internal data, do not iterate on them. */
|
||||
case LIT_INTERNAL_MAGIC_STRING_CONTAINER: return false;
|
||||
case LIT_INTERNAL_MAGIC_STRING_INTERNAL_OBJECT: return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user