summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-31.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-31.js')
-rw-r--r--test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-31.js64
1 files changed, 30 insertions, 34 deletions
diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-31.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-31.js
index adc024dca..8d8168a56 100644
--- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-31.js
+++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-31.js
@@ -9,39 +9,35 @@ description: >
iteration is observed subsequetly on an Array-like object
---*/
-var testResult = false;
-
-function callbackfn(prevVal, curVal, idx, obj) {
- if (idx === 1) {
- testResult = (prevVal === 2 && curVal === 1);
- }
-}
-
-var obj = {
- 0: 0,
- length: 3
-};
-var preIterVisible = false;
-
-Object.defineProperty(obj, "1", {
- get: function() {
- if (preIterVisible) {
- return 1;
- } else {
- return "20";
- }
- },
- configurable: true
-});
-
-Object.defineProperty(obj, "2", {
- get: function() {
- preIterVisible = true;
- return 2;
- },
- configurable: true
-});
-
-Array.prototype.reduceRight.call(obj, callbackfn);
+ var testResult = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx === 1) {
+ testResult = (prevVal === 2 && curVal === 1);
+ }
+ }
+
+ var obj = { 0: 0, length: 3 };
+ var preIterVisible = false;
+
+ Object.defineProperty(obj, "1", {
+ get: function () {
+ if (preIterVisible) {
+ return 1;
+ } else {
+ return "20";
+ }
+ },
+ configurable: true
+ });
+
+ Object.defineProperty(obj, "2", {
+ get: function () {
+ preIterVisible = true;
+ return 2;
+ },
+ configurable: true
+ });
+
+ Array.prototype.reduceRight.call(obj, callbackfn);
assert(testResult, 'testResult !== true');