summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js')
-rw-r--r--test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js34
1 files changed, 20 insertions, 14 deletions
diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js
index d77985dd3..15298bc3e 100644
--- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js
+++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js
@@ -10,22 +10,28 @@ description: >
Array-like object
---*/
- var testResult = false;
- function callbackfn(prevVal, curVal, idx, obj) {
- if (idx === 1) {
- testResult = (prevVal === "9");
- }
- }
+var testResult = false;
- var proto = { 0: 0, 1: 1, 2: 2, length: 3 };
- var Con = function () { };
- Con.prototype = proto;
+function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === "9");
+ }
+}
- var child = new Con();
- child[0] = "9";
- child[1] = "1";
- child.length = 3;
+var proto = {
+ 0: 0,
+ 1: 1,
+ 2: 2,
+ length: 3
+};
+var Con = function() {};
+Con.prototype = proto;
- Array.prototype.reduce.call(child, callbackfn);
+var child = new Con();
+child[0] = "9";
+child[1] = "1";
+child.length = 3;
+
+Array.prototype.reduce.call(child, callbackfn);
assert(testResult, 'testResult !== true');