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:
@@ -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"); } });
|
||||
|
||||
Reference in New Issue
Block a user