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:
Roland Takacs
2020-03-17 19:30:55 +01:00
committed by GitHub
parent 1cfda262bd
commit 51a9575fd0
10 changed files with 726 additions and 437 deletions
+1 -3
View File
@@ -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;
}
}