Home | History | Annotate | Download | only in webkit

Lines Matching defs:toObject

28 function toObject(array) {
52 shouldBe("toObject([0,1,2,3]).reduce(function(a,b){ return a + b; })", "6");
53 shouldBe("toObject([1,2,3]).reduce(function(a,b){ return a + b; })", "6");
54 shouldBe("toObject([0,1,2,3]).reduce(function(a,b){ return a + b; }, 4)", "10");
55 shouldBe("toObject([1,2,3]).reduce(function(a,b){ return a + b; }, 4)", "10");
63 shouldBe("toObject(sparseArray).reduce(function(a,b){ return a + b; }, 0)", "10");
67 shouldBe("toObject(sparseArray).reduce(function(a,b){ callCount++; }); callCount", "0");
71 shouldBe("toObject(sparseArray).reduce(function(a,b){ callCount++; }, 0); callCount", "1");
81 shouldBe("toObject([1, 2, 3, 4]).reduce(function(a,b, i, thisObj){ thisObj.length--; callCount++; return a + b; }, 0); callCount", "4");
83 shouldBe("toObject([1, 2, 3, 4]).reduce(function(a,b, i, thisObj){ thisObj.length++; callCount++; return a + b; }, 0); callCount", "4");
86 shouldBe("toObject([[0,1], [2,3], [4,5]]).reduce(function(a,b) {return a.concat(b);}, [])", "[0,1,2,3,4,5]");
87 shouldBe("toObject([0,1,2,3,4,5]).reduce(function(a,b,i) {return a.concat([i,b]);}, [])", "[0,0,1,1,2,2,3,3,4,4,5,5]");