Add value/key sign swap for Set.add and Map.set methods (#3681)
See also: ECMA-262 v6, 23.2.3.1 step 6 and 23.1.3.9 step 6 JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
@@ -147,3 +147,13 @@ try {
|
||||
} catch(e){}
|
||||
|
||||
assert(closed === true);
|
||||
|
||||
var map = new Map();
|
||||
map.set(-0, "foo");
|
||||
var k;
|
||||
map.forEach(function (value, key) {
|
||||
k = 1 / key;
|
||||
});
|
||||
|
||||
assert(k === Infinity);
|
||||
assert(map.get(+0) === "foo");
|
||||
|
||||
Reference in New Issue
Block a user