Fix weakrefs when adding a key to the same container multiple times (#3343)

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
Dániel Bátyai
2019-11-22 13:55:36 +01:00
committed by Zoltan Herczeg
parent 3bf2bc50bc
commit fc2218e828
6 changed files with 98 additions and 75 deletions
+17
View File
@@ -95,6 +95,23 @@ gc();
m1 = undefined;
gc();
m1 = new WeakSet();
k1 = {};
m1.add (k1);
m1.add (k1);
m1.add (k1);
assert (m1.has (k1));
k1 = {};
gc();
m1 = new WeakSet();
m1.add (k1);
m1.add (k1);
m1.add (k1);
assert (m1.has (k1));
m1 = new WeakSet();
gc();
try {
new WeakSet([1,2,3,4]);
assert (false);