summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-16.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-16.js')
-rw-r--r--test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-16.js32
1 files changed, 13 insertions, 19 deletions
diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-16.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-16.js
index ac8deb3c9..6d75ccf2e 100644
--- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-16.js
+++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-3-16.js
@@ -9,28 +9,22 @@ description: >
containing a hex number
---*/
-var testResult1 = true;
-var testResult2 = false;
+ var testResult1 = true;
+ var testResult2 = false;
+ function callbackfn(prevVal, curVal, idx, obj) {
+ if (idx > 1) {
+ testResult1 = false;
+ }
-function callbackfn(prevVal, curVal, idx, obj) {
- if (idx > 1) {
- testResult1 = false;
- }
+ if (idx === 1) {
+ testResult2 = true;
+ }
+ return false;
+ }
- if (idx === 1) {
- testResult2 = true;
- }
- return false;
-}
+ var obj = { 0: 12, 1: 11, 2: 9, length: "0x0002" };
-var obj = {
- 0: 12,
- 1: 11,
- 2: 9,
- length: "0x0002"
-};
-
-Array.prototype.reduceRight.call(obj, callbackfn, 1);
+ Array.prototype.reduceRight.call(obj, callbackfn, 1);
assert(testResult1, 'testResult1 !== true');
assert(testResult2, 'testResult2 !== true');