summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js')
-rw-r--r--test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js33
1 files changed, 19 insertions, 14 deletions
diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js
index 82a348b81..d61c61aea 100644
--- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js
+++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js
@@ -9,21 +9,26 @@ description: >
property on an Array-like object
---*/
- var testResult = false;
- function callbackfn(prevVal, curVal, idx, obj) {
- if (idx === 1) {
- testResult = (prevVal === 0);
- }
- }
+var testResult = false;
- var obj = { 1: 1, 2: 2, length: 3 };
- Object.defineProperty(obj, "0", {
- get: function () {
- return 0;
- },
- configurable: true
- });
+function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 0);
+ }
+}
- Array.prototype.reduce.call(obj, callbackfn);
+var obj = {
+ 1: 1,
+ 2: 2,
+ length: 3
+};
+Object.defineProperty(obj, "0", {
+ get: function() {
+ return 0;
+ },
+ configurable: true
+});
+
+Array.prototype.reduce.call(obj, callbackfn);
assert(testResult, 'testResult !== true');