Fix Array index normalize helper when index is large.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
This commit is contained in:
Dániel Bátyai
2015-07-23 13:55:54 +02:00
committed by Peter Gal
parent ee8d65063f
commit 6567651b6c
3 changed files with 50 additions and 8 deletions
+13
View File
@@ -131,6 +131,19 @@ assert (array10[0] == undefined);
assert (array10[1] == -127);
assert (array10[2] == "sunshine");
var array = [];
array[4294967294] = "foo";
var result = array.splice(4294967294, 1, "x")
assert(result.length === 1)
assert(result[0] === "foo")
assert(array[4294967294] === "x")
array[0] = "bar";
var result = array.splice(-4294967295, 1, "y");
assert(result.length === 1)
assert(result[0] === "bar")
assert(array[0] === "y")
// Checking behavior when unable to get length
var obj = {splice : Array.prototype.splice};
Object.defineProperty(obj, 'length', { 'get' : function () { throw new ReferenceError ("foo"); } });