michael@0: var a = [, , , , , , ]; michael@0: var res = 0; michael@0: exhaustiveSliceTest("exhaustive slice test 1", a); michael@0: function mySlice(a, from, to) { michael@0: var to2 = to; michael@0: if (to2 > 0) { michael@0: res += to2; michael@0: to2 = to2.length + to; michael@0: } michael@0: } michael@0: function exhaustiveSliceTest(testname, a) { x = a; } michael@0: for (y = a.length; y >= 0; y--) { michael@0: mySlice(a, x, y); michael@0: } michael@0: assertEq(res, 21);