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:
@@ -62,6 +62,13 @@ assert (long_array.map(func).equals([0,2]));
|
||||
long_array[100] = 1;
|
||||
assert (long_array.map(func).equals([0,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,101]));
|
||||
|
||||
var arr = [1,2];
|
||||
Array.prototype[0] = 3;
|
||||
var newArr = arr.map(function(value) { return value; });
|
||||
delete Array.prototype[0];
|
||||
assert(newArr.hasOwnProperty("0"));
|
||||
assert(newArr[0] === 1);
|
||||
|
||||
// check behavior when unable to get length
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, 'length', { 'get' : function () {throw new ReferenceError ("foo"); } });
|
||||
|
||||
Reference in New Issue
Block a user