michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ michael@0: */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 614070; michael@0: var summary = 'Array.prototype.unshift without args'; michael@0: michael@0: print(BUGNUMBER + ": " + summary); michael@0: michael@0: /************** michael@0: * BEGIN TEST * michael@0: **************/ michael@0: michael@0: var a = {}; michael@0: a.length = 4294967296; michael@0: assertEq([].unshift.call(a), 0); michael@0: assertEq(a.length, 0); michael@0: michael@0: function testGetSet(len, expected) { michael@0: var newlen; michael@0: var a = { get length() { return len; }, set length(v) { newlen = v; } }; michael@0: var res = [].unshift.call(a); michael@0: assertEq(res, expected); michael@0: assertEq(newlen, expected); michael@0: } michael@0: michael@0: testGetSet(0, 0); michael@0: testGetSet(10, 10); michael@0: testGetSet("1", 1); michael@0: testGetSet(null, 0); michael@0: testGetSet(4294967297, 1); michael@0: testGetSet(-5, 4294967291); michael@0: michael@0: /******************************************************************************/ michael@0: michael@0: if (typeof reportCompare === "function") michael@0: reportCompare(true, true); michael@0: michael@0: print("All tests passed!");