Use [[DefineOwnProperty]] in Array builtins where necessary.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
This commit is contained in:
@@ -144,6 +144,13 @@ assert(result.length === 1)
|
||||
assert(result[0] === "bar")
|
||||
assert(array[0] === "y")
|
||||
|
||||
var arr = [1,2];
|
||||
Array.prototype[0] = 3;
|
||||
var newArr = arr.splice(0, 1);
|
||||
delete Array.prototype[0];
|
||||
assert(newArr.hasOwnProperty("0"));
|
||||
assert(newArr[0] === 1);
|
||||
|
||||
// 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