summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-2.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-2.js')
-rw-r--r--test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-2.js29
1 files changed, 15 insertions, 14 deletions
diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-2.js
index c2c0b4e85..96e4d9109 100644
--- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-2.js
+++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-2.js
@@ -9,22 +9,23 @@ description: >
number of iterations in step 9
---*/
- var called = 0;
- function callbackfn(prevVal, curVal, idx, obj) {
- called++;
- return prevVal + curVal;
- }
+var called = 0;
- var arr = [0, 1, 2, 3];
- Object.defineProperty(arr, "4", {
- get: function () {
- arr.length = 2;
- return 10;
- },
- configurable: true
- });
+function callbackfn(prevVal, curVal, idx, obj) {
+ called++;
+ return prevVal + curVal;
+}
- var preVal = arr.reduceRight(callbackfn);
+var arr = [0, 1, 2, 3];
+Object.defineProperty(arr, "4", {
+ get: function() {
+ arr.length = 2;
+ return 10;
+ },
+ configurable: true
+});
+
+var preVal = arr.reduceRight(callbackfn);
assert.sameValue(preVal, 11, 'preVal');
assert.sameValue(called, 2, 'called');