Replace runTestCase with assert helpers [test/built-ins/Array/prototype/reduceRight]

This commit is contained in:
André Bargull 2015-08-06 18:19:31 +02:00
parent df43797c70
commit 174f24b2f3
157 changed files with 324 additions and 965 deletions

View File

@ -4,13 +4,8 @@
/*--- /*---
es5id: 15.4.4.22-0-1 es5id: 15.4.4.22-0-1
description: Array.prototype.reduceRight must exist as a function description: Array.prototype.reduceRight must exist as a function
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var f = Array.prototype.reduceRight; var f = Array.prototype.reduceRight;
if (typeof(f) === "function") {
return true; assert.sameValue(typeof(f), "function", 'typeof(f)');
}
}
runTestCase(testcase);

View File

@ -4,12 +4,6 @@
/*--- /*---
es5id: 15.4.4.22-0-2 es5id: 15.4.4.22-0-2
description: Array.prototype.reduceRight.length must be 1 description: Array.prototype.reduceRight.length must be 1
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Array.prototype.reduceRight.length, 1, 'Array.prototype.reduceRight.length');
if (Array.prototype.reduceRight.length === 1) {
return true;
}
}
runTestCase(testcase);

View File

@ -4,11 +4,8 @@
/*--- /*---
es5id: 15.4.4.22-1-11 es5id: 15.4.4.22-1-11
description: Array.prototype.reduceRight applied to Date object description: Array.prototype.reduceRight applied to Date object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = new Date(); var obj = new Date();
obj.length = 1; obj.length = 1;
obj[0] = 1; obj[0] = 1;
@ -19,6 +16,5 @@ function testcase() {
return obj instanceof Date; return obj instanceof Date;
} }
return Array.prototype.reduceRight.call(obj, callbackfn, 1) && accessed; assert(Array.prototype.reduceRight.call(obj, callbackfn, 1), 'Array.prototype.reduceRight.call(obj, callbackfn, 1) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -4,11 +4,8 @@
/*--- /*---
es5id: 15.4.4.22-1-12 es5id: 15.4.4.22-1-12
description: Array.prototype.reduceRight applied to RegExp object description: Array.prototype.reduceRight applied to RegExp object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = new RegExp(); var obj = new RegExp();
obj.length = 1; obj.length = 1;
obj[0] = 1; obj[0] = 1;
@ -19,6 +16,5 @@ function testcase() {
return o instanceof RegExp; return o instanceof RegExp;
} }
return Array.prototype.reduceRight.call(obj, callbackfn, 1) && accessed; assert(Array.prototype.reduceRight.call(obj, callbackfn, 1), 'Array.prototype.reduceRight.call(obj, callbackfn, 1) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -4,11 +4,8 @@
/*--- /*---
es5id: 15.4.4.22-1-14 es5id: 15.4.4.22-1-14
description: Array.prototype.reduceRight applied to Error object description: Array.prototype.reduceRight applied to Error object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = new Error(); var obj = new Error();
obj.length = 1; obj.length = 1;
obj[0] = 1; obj[0] = 1;
@ -19,6 +16,5 @@ function testcase() {
return o instanceof Error; return o instanceof Error;
} }
return Array.prototype.reduceRight.call(obj, callbackfn, 1) && accessed; assert(Array.prototype.reduceRight.call(obj, callbackfn, 1), 'Array.prototype.reduceRight.call(obj, callbackfn, 1) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -4,11 +4,8 @@
/*--- /*---
es5id: 15.4.4.22-1-15 es5id: 15.4.4.22-1-15
description: Array.prototype.reduceRight applied to the Arguments object description: Array.prototype.reduceRight applied to the Arguments object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -20,6 +17,5 @@ function testcase() {
return arguments; return arguments;
}("a", "b")); }("a", "b"));
return Array.prototype.reduceRight.call(obj, callbackfn, "a") && accessed; assert(Array.prototype.reduceRight.call(obj, callbackfn, "a"), 'Array.prototype.reduceRight.call(obj, callbackfn, "a") !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -4,11 +4,8 @@
/*--- /*---
es5id: 15.4.4.22-1-4 es5id: 15.4.4.22-1-4
description: Array.prototype.reduceRight applied to Boolean object description: Array.prototype.reduceRight applied to Boolean object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = new Boolean(true); var obj = new Boolean(true);
obj.length = 2; obj.length = 2;
obj[0] = 11; obj[0] = 11;
@ -20,6 +17,5 @@ function testcase() {
return obj instanceof Boolean; return obj instanceof Boolean;
} }
return Array.prototype.reduceRight.call(obj, callbackfn, 11) && accessed; assert(Array.prototype.reduceRight.call(obj, callbackfn, 11), 'Array.prototype.reduceRight.call(obj, callbackfn, 11) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -4,11 +4,8 @@
/*--- /*---
es5id: 15.4.4.22-1-6 es5id: 15.4.4.22-1-6
description: Array.prototype.reduceRight applied to Number object description: Array.prototype.reduceRight applied to Number object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = new Number(-128); var obj = new Number(-128);
obj.length = 2; obj.length = 2;
obj[0] = 11; obj[0] = 11;
@ -20,6 +17,5 @@ function testcase() {
return o instanceof Number; return o instanceof Number;
} }
return Array.prototype.reduceRight.call(obj, callbackfn, 11) && accessed; assert(Array.prototype.reduceRight.call(obj, callbackfn, 11), 'Array.prototype.reduceRight.call(obj, callbackfn, 11) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -4,11 +4,8 @@
/*--- /*---
es5id: 15.4.4.22-1-7 es5id: 15.4.4.22-1-7
description: Array.prototype.reduceRight applied to string primitive description: Array.prototype.reduceRight applied to string primitive
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -16,6 +13,5 @@ function testcase() {
return obj instanceof String; return obj instanceof String;
} }
return Array.prototype.reduceRight.call("hello\nworld\\!", callbackfn, "h") && accessed; assert(Array.prototype.reduceRight.call("hello\nworld\\!", callbackfn, "h"), 'Array.prototype.reduceRight.call("hello\nworld\\!", callbackfn, "h") !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -4,11 +4,8 @@
/*--- /*---
es5id: 15.4.4.22-1-8 es5id: 15.4.4.22-1-8
description: Array.prototype.reduceRight applied to String object description: Array.prototype.reduceRight applied to String object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = new String("hello\nworld\\!"); var obj = new String("hello\nworld\\!");
var accessed = false; var accessed = false;
@ -17,6 +14,5 @@ function testcase() {
return o instanceof String; return o instanceof String;
} }
return Array.prototype.reduceRight.call(obj, callbackfn, "h") && accessed; assert(Array.prototype.reduceRight.call(obj, callbackfn, "h"), 'Array.prototype.reduceRight.call(obj, callbackfn, "h") !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -4,11 +4,8 @@
/*--- /*---
es5id: 15.4.4.22-1-9 es5id: 15.4.4.22-1-9
description: Array.prototype.reduceRight applied to Function object description: Array.prototype.reduceRight applied to Function object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = function (a, b) { var obj = function (a, b) {
return a + b; return a + b;
}; };
@ -21,6 +18,5 @@ function testcase() {
return o instanceof Function; return o instanceof Function;
} }
return Array.prototype.reduceRight.call(obj, callbackfn, 11) && accessed; assert(Array.prototype.reduceRight.call(obj, callbackfn, 11), 'Array.prototype.reduceRight.call(obj, callbackfn, 11) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -6,25 +6,17 @@ es5id: 15.4.4.22-10-1
description: > description: >
Array.prototype.reduceRight doesn't mutate the Array on which it Array.prototype.reduceRight doesn't mutate the Array on which it
is called on is called on
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function callbackfn(prevVal, curVal, idx, obj) function callbackfn(prevVal, curVal, idx, obj)
{ {
return 1; return 1;
} }
var srcArr = [1,2,3,4,5]; var srcArr = [1,2,3,4,5];
srcArr.reduceRight(callbackfn); srcArr.reduceRight(callbackfn);
if(srcArr[0] === 1 &&
srcArr[1] === 2 &&
srcArr[2] === 3 &&
srcArr[3] === 4 &&
srcArr[4] === 5)
{
return true;
}
} assert.sameValue(srcArr[0], 1, 'srcArr[0]');
runTestCase(testcase); assert.sameValue(srcArr[1], 2, 'srcArr[1]');
assert.sameValue(srcArr[2], 3, 'srcArr[2]');
assert.sameValue(srcArr[3], 4, 'srcArr[3]');
assert.sameValue(srcArr[4], 5, 'srcArr[4]');

View File

@ -6,20 +6,12 @@ es5id: 15.4.4.22-10-2
description: > description: >
Array.prototype.reduceRight reduces array in descending order of Array.prototype.reduceRight reduces array in descending order of
indices indices
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function callbackfn(prevVal, curVal, idx, obj) function callbackfn(prevVal, curVal, idx, obj)
{ {
return prevVal + curVal; return prevVal + curVal;
} }
var srcArr = ['1','2','3','4','5']; var srcArr = ['1','2','3','4','5'];
if(srcArr.reduceRight(callbackfn) === '54321')
{
return true;
}
} assert.sameValue(srcArr.reduceRight(callbackfn), '54321', 'srcArr.reduceRight(callbackfn)');
runTestCase(testcase);

View File

@ -4,16 +4,12 @@
/*--- /*---
es5id: 15.4.4.22-10-3 es5id: 15.4.4.22-10-3
description: Array.prototype.reduceRight - subclassed array with length 1 description: Array.prototype.reduceRight - subclassed array with length 1
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
foo.prototype = [1]; foo.prototype = [1];
function foo() {} function foo() {}
var f = new foo(); var f = new foo();
function cb(){} function cb(){}
if(f.reduceRight(cb) === 1)
return true; assert.sameValue(f.reduceRight(cb), 1, 'f.reduceRight(cb)');
}
runTestCase(testcase);

View File

@ -6,16 +6,12 @@ es5id: 15.4.4.22-10-4
description: > description: >
Array.prototype.reduceRight - subclassed array with length more Array.prototype.reduceRight - subclassed array with length more
than 1 than 1
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
foo.prototype = new Array(0, 1, 2, 3); foo.prototype = new Array(0, 1, 2, 3);
function foo() {} function foo() {}
var f = new foo(); var f = new foo();
function cb(prevVal, curVal, idx, obj){return prevVal + curVal;} function cb(prevVal, curVal, idx, obj){return prevVal + curVal;}
if(f.reduceRight(cb) === 6)
return true; assert.sameValue(f.reduceRight(cb), 6, 'f.reduceRight(cb)');
}
runTestCase(testcase);

View File

@ -6,20 +6,12 @@ es5id: 15.4.4.22-10-5
description: > description: >
Array.prototype.reduceRight reduces array in descending order of Array.prototype.reduceRight reduces array in descending order of
indices(initialvalue present) indices(initialvalue present)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function callbackfn(prevVal, curVal, idx, obj) function callbackfn(prevVal, curVal, idx, obj)
{ {
return prevVal + curVal; return prevVal + curVal;
} }
var srcArr = ['1','2','3','4','5']; var srcArr = ['1','2','3','4','5'];
if(srcArr.reduceRight(callbackfn,'6') === '654321')
{
return true;
}
} assert.sameValue(srcArr.reduceRight(callbackfn,'6'), '654321', 'srcArr.reduceRight(callbackfn,"6")');
runTestCase(testcase);

View File

@ -6,16 +6,12 @@ es5id: 15.4.4.22-10-6
description: > description: >
Array.prototype.reduceRight - subclassed array when initialvalue Array.prototype.reduceRight - subclassed array when initialvalue
provided provided
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
foo.prototype = new Array(0, 1, 2, 3); foo.prototype = new Array(0, 1, 2, 3);
function foo() {} function foo() {}
var f = new foo(); var f = new foo();
function cb(prevVal, curVal, idx, obj){return prevVal + curVal;} function cb(prevVal, curVal, idx, obj){return prevVal + curVal;}
if(f.reduceRight(cb,"4") === "43210")
return true; assert.sameValue(f.reduceRight(cb,"4"), "43210", 'f.reduceRight(cb,"4")');
}
runTestCase(testcase);

View File

@ -6,16 +6,12 @@ es5id: 15.4.4.22-10-7
description: > description: >
Array.prototype.reduceRight - subclassed array when length to 1 Array.prototype.reduceRight - subclassed array when length to 1
and initialvalue provided and initialvalue provided
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
foo.prototype = [1]; foo.prototype = [1];
function foo() {} function foo() {}
var f = new foo(); var f = new foo();
function cb(prevVal, curVal, idx, obj){return prevVal + curVal;} function cb(prevVal, curVal, idx, obj){return prevVal + curVal;}
if(f.reduceRight(cb,"4") === "41")
return true; assert.sameValue(f.reduceRight(cb,"4"), "41", 'f.reduceRight(cb,"4")');
}
runTestCase(testcase);

View File

@ -4,11 +4,8 @@
/*--- /*---
es5id: 15.4.4.22-10-8 es5id: 15.4.4.22-10-8
description: Array.prototype.reduceRight doesn't visit expandos description: Array.prototype.reduceRight doesn't visit expandos
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var callCnt = 0; var callCnt = 0;
function callbackfn(prevVal, curVal, idx, obj) function callbackfn(prevVal, curVal, idx, obj)
{ {
@ -20,10 +17,4 @@ function testcase() {
srcArr.reduceRight(callbackfn); srcArr.reduceRight(callbackfn);
if(callCnt == 4) assert.sameValue(callCnt, 4, 'callCnt');
{
return true;
}
}
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-1
description: > description: >
Array.prototype.reduceRight applied to Array-like object, 'length' Array.prototype.reduceRight applied to Array-like object, 'length'
is an own data property is an own data property
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var obj = { var obj = {
0: 12, 0: 12,
@ -24,6 +21,5 @@ function testcase() {
return obj.length === 2; return obj.length === 2;
} }
return Array.prototype.reduceRight.call(obj, callbackfn, 11) && accessed; assert(Array.prototype.reduceRight.call(obj, callbackfn, 11), 'Array.prototype.reduceRight.call(obj, callbackfn, 11) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-10
description: > description: >
Array.prototype.reduceRight applied to Array-like object, 'length' Array.prototype.reduceRight applied to Array-like object, 'length'
is an inherited accessor property is an inherited accessor property
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var Con = function () { }; var Con = function () { };
@ -37,6 +34,5 @@ function testcase() {
child[2] = 9; child[2] = 9;
return Array.prototype.reduceRight.call(child, callbackfn, 11) && accessed; assert(Array.prototype.reduceRight.call(child, callbackfn, 11), 'Array.prototype.reduceRight.call(child, callbackfn, 11) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-11
description: > description: >
Array.prototype.reduceRight applied to Array-like object, 'length' Array.prototype.reduceRight applied to Array-like object, 'length'
is an own accessor property without a get function is an own accessor property without a get function
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -27,6 +24,5 @@ function testcase() {
configurable: true configurable: true
}); });
return Array.prototype.reduceRight.call(obj, callbackfn, 111) === 111 && !accessed; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 111), 111, 'Array.prototype.reduceRight.call(obj, callbackfn, 111)');
} assert.sameValue(accessed, false, 'accessed');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-13
description: > description: >
Array.prototype.reduceRight applied to the Array-like object that Array.prototype.reduceRight applied to the Array-like object that
'length' is inherited accessor property without a get function 'length' is inherited accessor property without a get function
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -31,6 +28,5 @@ function testcase() {
child[0] = 11; child[0] = 11;
child[1] = 12; child[1] = 12;
return Array.prototype.reduceRight.call(child, callbackfn, 111) === 111 && !accessed; assert.sameValue(Array.prototype.reduceRight.call(child, callbackfn, 111), 111, 'Array.prototype.reduceRight.call(child, callbackfn, 111)');
} assert.sameValue(accessed, false, 'accessed');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-14
description: > description: >
Array.prototype.reduceRight applied to the Array-like object that Array.prototype.reduceRight applied to the Array-like object that
'length' property doesn't exist 'length' property doesn't exist
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = { 0: 11, 1: 12 }; var obj = { 0: 11, 1: 12 };
var accessed = false; var accessed = false;
@ -19,6 +16,5 @@ function testcase() {
return curVal > 10; return curVal > 10;
} }
return Array.prototype.reduceRight.call(obj, callbackfn, 111) === 111 && !accessed; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 111), 111, 'Array.prototype.reduceRight.call(obj, callbackfn, 111)');
} assert.sameValue(accessed, false, 'accessed');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-17
description: > description: >
Array.prototype.reduceRight applied to the Arguments object, which Array.prototype.reduceRight applied to the Arguments object, which
implements its own property get method implements its own property get method
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var arg; var arg;
var accessed = false; var accessed = false;
@ -24,6 +21,5 @@ function testcase() {
return Array.prototype.reduceRight.call(arguments, callbackfn, 11); return Array.prototype.reduceRight.call(arguments, callbackfn, 11);
}; };
return func(12, 11) && accessed; assert(func(12, 11), 'func(12, 11) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-19
description: > description: >
Array.prototype.reduceRight applied to Function object, which Array.prototype.reduceRight applied to Function object, which
implements its own property get method implements its own property get method
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var fun = function (a, b) { var fun = function (a, b) {
return a + b; return a + b;
@ -24,6 +21,5 @@ function testcase() {
return obj.length === 2; return obj.length === 2;
} }
return Array.prototype.reduceRight.call(fun, callbackfn, 11) && accessed; assert(Array.prototype.reduceRight.call(fun, callbackfn, 11), 'Array.prototype.reduceRight.call(fun, callbackfn, 11) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-2
description: > description: >
Array.prototype.reduceRight - 'length' is own data property on an Array.prototype.reduceRight - 'length' is own data property on an
Array Array
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -18,6 +15,5 @@ function testcase() {
return obj.length === 2; return obj.length === 2;
} }
return [12, 11].reduceRight(callbackfn, 11) && accessed; assert([12, 11].reduceRight(callbackfn, 11), '[12, 11].reduceRight(callbackfn, 11) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-3
description: > description: >
Array.prototype.reduceRight applied to Array-like object, 'length' Array.prototype.reduceRight applied to Array-like object, 'length'
is an own data property that overrides an inherited data property is an own data property that overrides an inherited data property
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = true; var accessed = true;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -29,6 +26,5 @@ function testcase() {
child[1] = 11; child[1] = 11;
child[2] = 9; child[2] = 9;
return Array.prototype.reduceRight.call(child, callbackfn) && accessed; assert(Array.prototype.reduceRight.call(child, callbackfn), 'Array.prototype.reduceRight.call(child, callbackfn) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Array.prototype.reduceRight applied to Array-like object, 'length' Array.prototype.reduceRight applied to Array-like object, 'length'
is an own data property that overrides an inherited accessor is an own data property that overrides an inherited accessor
property property
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -39,6 +36,5 @@ function testcase() {
child[1] = 11; child[1] = 11;
child[2] = 9; child[2] = 9;
return Array.prototype.reduceRight.call(child, callbackfn) && accessed; assert(Array.prototype.reduceRight.call(child, callbackfn), 'Array.prototype.reduceRight.call(child, callbackfn) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-6
description: > description: >
Array.prototype.reduceRight applied to Array-like object, 'length' Array.prototype.reduceRight applied to Array-like object, 'length'
is an inherited data property is an inherited data property
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var proto = { length: 2 }; var proto = { length: 2 };
var Con = function () { }; var Con = function () { };
@ -26,6 +23,5 @@ function testcase() {
return obj.length === 2; return obj.length === 2;
} }
return Array.prototype.reduceRight.call(child, callbackfn1, 11) && accessed; assert(Array.prototype.reduceRight.call(child, callbackfn1, 11), 'Array.prototype.reduceRight.call(child, callbackfn1, 11) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-7
description: > description: >
Array.prototype.reduceRight applied to Array-like object, 'length' Array.prototype.reduceRight applied to Array-like object, 'length'
is an own accessor property is an own accessor property
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = true; var accessed = true;
var obj = {}; var obj = {};
obj[0] = 12; obj[0] = 12;
@ -29,6 +26,5 @@ function testcase() {
configurable: true configurable: true
}); });
return Array.prototype.reduceRight.call(obj, callbackfn, 11) && accessed; assert(Array.prototype.reduceRight.call(obj, callbackfn, 11), 'Array.prototype.reduceRight.call(obj, callbackfn, 11) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Array.prototype.reduceRight applied to Array-like object, 'length' Array.prototype.reduceRight applied to Array-like object, 'length'
is an own accessor property that overrides an inherited data is an own accessor property that overrides an inherited data
property property
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -37,6 +34,5 @@ function testcase() {
child[1] = 11; child[1] = 11;
child[2] = 9; child[2] = 9;
return Array.prototype.reduceRight.call(child, callbackfn, 11) && accessed; assert(Array.prototype.reduceRight.call(child, callbackfn, 11), 'Array.prototype.reduceRight.call(child, callbackfn, 11) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Array.prototype.reduceRight applied to Array-like object, 'length' Array.prototype.reduceRight applied to Array-like object, 'length'
is an own accessor property that overrides an inherited accessor is an own accessor property that overrides an inherited accessor
property property
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn1(prevVal, curVal, idx, obj) { function callbackfn1(prevVal, curVal, idx, obj) {
@ -41,6 +38,5 @@ function testcase() {
child[1] = 11; child[1] = 11;
child[2] = 9; child[2] = 9;
return Array.prototype.reduceRight.call(child, callbackfn1, 111) && accessed; assert(Array.prototype.reduceRight.call(child, callbackfn1, 111), 'Array.prototype.reduceRight.call(child, callbackfn1, 111) !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -4,11 +4,8 @@
/*--- /*---
es5id: 15.4.4.22-3-1 es5id: 15.4.4.22-3-1
description: Array.prototype.reduceRight - value of 'length' is undefined description: Array.prototype.reduceRight - value of 'length' is undefined
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -17,6 +14,5 @@ function testcase() {
var obj = { 0: 9, length: undefined }; var obj = { 0: 9, length: undefined };
return Array.prototype.reduceRight.call(obj, callbackfn, 1) === 1 && !accessed; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), 1, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)');
} assert.sameValue(accessed, false, 'accessed');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-10
description: > description: >
Array.prototype.reduceRight - value of 'length' is a number (value Array.prototype.reduceRight - value of 'length' is a number (value
is NaN) is NaN)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -19,6 +16,5 @@ function testcase() {
var obj = { 0: 9, length: NaN }; var obj = { 0: 9, length: NaN };
return Array.prototype.reduceRight.call(obj, callbackfn, 1) === 1 && !accessed; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), 1, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)');
} assert.sameValue(accessed, false, 'accessed');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-11
description: > description: >
Array.prototype.reduceRight - value of 'length' is a string Array.prototype.reduceRight - value of 'length' is a string
containing a positive number containing a positive number
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult1 = true; var testResult1 = true;
var testResult2 = false; var testResult2 = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -27,6 +24,6 @@ function testcase() {
var obj = { 0: 12, 1: 11, 2: 9, length: "2" }; var obj = { 0: 12, 1: 11, 2: 9, length: "2" };
Array.prototype.reduceRight.call(obj, callbackfn, 1); Array.prototype.reduceRight.call(obj, callbackfn, 1);
return testResult1 && testResult2;
} assert(testResult1, 'testResult1 !== true');
runTestCase(testcase); assert(testResult2, 'testResult2 !== true');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-12
description: > description: >
Array.prototype.reduceRight - value of 'length' is a string Array.prototype.reduceRight - value of 'length' is a string
containing a negative number containing a negative number
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult1 = true; var testResult1 = true;
var testResult2 = false; var testResult2 = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -27,6 +24,6 @@ function testcase() {
var obj = { 0: 11, 1: 12, 2: 9, length: "-4294967294" }; var obj = { 0: 11, 1: 12, 2: 9, length: "-4294967294" };
Array.prototype.reduceRight.call(obj, callbackfn, 1); Array.prototype.reduceRight.call(obj, callbackfn, 1);
return testResult1 && !testResult2;
} assert(testResult1, 'testResult1 !== true');
runTestCase(testcase); assert.sameValue(testResult2, false, 'testResult2');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-13
description: > description: >
Array.prototype.reduceRight - value of 'length' is a string Array.prototype.reduceRight - value of 'length' is a string
containing a decimal number containing a decimal number
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult1 = true; var testResult1 = true;
var testResult2 = false; var testResult2 = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -27,6 +24,6 @@ function testcase() {
var obj = { 0: 12, 1: 11, 2: 9, length: "2.5" }; var obj = { 0: 12, 1: 11, 2: 9, length: "2.5" };
Array.prototype.reduceRight.call(obj, callbackfn, 1); Array.prototype.reduceRight.call(obj, callbackfn, 1);
return testResult1 && testResult2;
} assert(testResult1, 'testResult1 !== true');
runTestCase(testcase); assert(testResult2, 'testResult2 !== true');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-14
description: > description: >
Array.prototype.reduceRight - value of 'length' is a string Array.prototype.reduceRight - value of 'length' is a string
containing -Infinity containing -Infinity
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed2 = false; var accessed2 = false;
function callbackfn2(prevVal, curVal, idx, obj) { function callbackfn2(prevVal, curVal, idx, obj) {
@ -19,7 +16,5 @@ function testcase() {
var obj2 = { 0: 9, length: "-Infinity" }; var obj2 = { 0: 9, length: "-Infinity" };
return Array.prototype.reduceRight.call(obj2, callbackfn2, 2) === 2 && assert.sameValue(Array.prototype.reduceRight.call(obj2, callbackfn2, 2), 2, 'Array.prototype.reduceRight.call(obj2, callbackfn2, 2)');
!accessed2; assert.sameValue(accessed2, false, 'accessed2');
}
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-15
description: > description: >
Array.prototype.reduceRight - value of 'length' is a string Array.prototype.reduceRight - value of 'length' is a string
containing an exponential number containing an exponential number
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult1 = true; var testResult1 = true;
var testResult2 = false; var testResult2 = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -27,6 +24,6 @@ function testcase() {
var obj = { 0: 12, 1: 11, 2: 9, length: "2E0" }; var obj = { 0: 12, 1: 11, 2: 9, length: "2E0" };
Array.prototype.reduceRight.call(obj, callbackfn, 1); Array.prototype.reduceRight.call(obj, callbackfn, 1);
return testResult1 && testResult2;
} assert(testResult1, 'testResult1 !== true');
runTestCase(testcase); assert(testResult2, 'testResult2 !== true');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-16
description: > description: >
Array.prototype.reduceRight - value of 'length' is a string Array.prototype.reduceRight - value of 'length' is a string
containing a hex number containing a hex number
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult1 = true; var testResult1 = true;
var testResult2 = false; var testResult2 = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -27,6 +24,6 @@ function testcase() {
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);
return testResult1 && testResult2;
} assert(testResult1, 'testResult1 !== true');
runTestCase(testcase); assert(testResult2, 'testResult2 !== true');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-17
description: > description: >
Array.prototype.reduceRight - value of 'length' is a string Array.prototype.reduceRight - value of 'length' is a string
containing a number with leading zeros containing a number with leading zeros
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult1 = true; var testResult1 = true;
var testResult2 = false; var testResult2 = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -27,6 +24,6 @@ function testcase() {
var obj = { 0: 12, 1: 11, 2: 9, length: "0002.00" }; var obj = { 0: 12, 1: 11, 2: 9, length: "0002.00" };
Array.prototype.reduceRight.call(obj, callbackfn, 1); Array.prototype.reduceRight.call(obj, callbackfn, 1);
return testResult1 && testResult2;
} assert(testResult1, 'testResult1 !== true');
runTestCase(testcase); assert(testResult2, 'testResult2 !== true');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-18
description: > description: >
Array.prototype.reduceRight - value of 'length' is a string that Array.prototype.reduceRight - value of 'length' is a string that
can't convert to a number can't convert to a number
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -19,6 +16,5 @@ function testcase() {
var obj = { 0: 9, 1: 8, length: "two" }; var obj = { 0: 9, 1: 8, length: "two" };
return Array.prototype.reduceRight.call(obj, callbackfn, 11) === 11 && !accessed; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 11), 11, 'Array.prototype.reduceRight.call(obj, callbackfn, 11)');
} assert.sameValue(accessed, false, 'accessed');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-19
description: > description: >
Array.prototype.reduceRight - value of 'length' is an object which Array.prototype.reduceRight - value of 'length' is an object which
has an own toString method has an own toString method
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult1 = true; var testResult1 = true;
var testResult2 = false; var testResult2 = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -44,6 +41,7 @@ function testcase() {
// resulting string to a number. // resulting string to a number.
Array.prototype.reduceRight.call(obj, callbackfn, 1); Array.prototype.reduceRight.call(obj, callbackfn, 1);
return testResult1 && testResult2 && toStringAccessed;
} assert(testResult1, 'testResult1 !== true');
runTestCase(testcase); assert(testResult2, 'testResult2 !== true');
assert(toStringAccessed, 'toStringAccessed !== true');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-2
description: > description: >
Array.prototype.reduceRight applied to an Array-like object, Array.prototype.reduceRight applied to an Array-like object,
'length' is 0 (length overridden to false(type conversion)) 'length' is 0 (length overridden to false(type conversion))
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(preVal, curVal, idx, obj) { function callbackfn(preVal, curVal, idx, obj) {
@ -19,6 +16,5 @@ function testcase() {
var obj = { 0: 9, length: false }; var obj = { 0: 9, length: false };
return Array.prototype.reduceRight.call(obj, callbackfn, 1) === 1 && !accessed; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), 1, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)');
} assert.sameValue(accessed, false, 'accessed');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-20
description: > description: >
Array.prototype.reduceRight - value of 'length' is an Object which Array.prototype.reduceRight - value of 'length' is an Object which
has an own valueOf method has an own valueOf method
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult1 = true; var testResult1 = true;
var testResult2 = false; var testResult2 = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -39,6 +36,7 @@ function testcase() {
}; };
Array.prototype.reduceRight.call(obj, callbackfn, 1); Array.prototype.reduceRight.call(obj, callbackfn, 1);
return testResult1 && testResult2 && valueOfAccessed;
} assert(testResult1, 'testResult1 !== true');
runTestCase(testcase); assert(testResult2, 'testResult2 !== true');
assert(valueOfAccessed, 'valueOfAccessed !== true');

View File

@ -7,11 +7,8 @@ description: >
Array.prototype.reduceRight - 'length' is an object that has an Array.prototype.reduceRight - 'length' is an object that has an
own valueOf method that returns an object and toString method that own valueOf method that returns an object and toString method that
returns a string returns a string
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult1 = true; var testResult1 = true;
var testResult2 = false; var testResult2 = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -45,6 +42,8 @@ function testcase() {
}; };
Array.prototype.reduceRight.call(obj, callbackfn, 1); Array.prototype.reduceRight.call(obj, callbackfn, 1);
return testResult1 && testResult2 && valueOfAccessed && toStringAccessed;
} assert(testResult1, 'testResult1 !== true');
runTestCase(testcase); assert(testResult2, 'testResult2 !== true');
assert(valueOfAccessed, 'valueOfAccessed !== true');
assert(toStringAccessed, 'toStringAccessed !== true');

View File

@ -7,11 +7,8 @@ description: >
Array.prototype.reduceRight uses inherited valueOf method when Array.prototype.reduceRight uses inherited valueOf method when
'length' is an object with an own toString and inherited valueOf 'length' is an object with an own toString and inherited valueOf
methods methods
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult1 = true; var testResult1 = true;
var testResult2 = false; var testResult2 = false;
var valueOfAccessed = false; var valueOfAccessed = false;
@ -51,6 +48,8 @@ function testcase() {
}; };
Array.prototype.reduceRight.call(obj, callbackfn, 1); Array.prototype.reduceRight.call(obj, callbackfn, 1);
return testResult1 && testResult2 && valueOfAccessed && !toStringAccessed;
} assert(testResult1, 'testResult1 !== true');
runTestCase(testcase); assert(testResult2, 'testResult2 !== true');
assert(valueOfAccessed, 'valueOfAccessed !== true');
assert.sameValue(toStringAccessed, false, 'toStringAccessed');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-24
description: > description: >
Array.prototype.reduceRight - value of 'length' is a positive Array.prototype.reduceRight - value of 'length' is a positive
non-integer, ensure truncation occurs in the proper direction non-integer, ensure truncation occurs in the proper direction
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult1 = true; var testResult1 = true;
var testResult2 = false; var testResult2 = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -27,6 +24,6 @@ function testcase() {
var obj = { 0: 12, 1: 11, 2: 9, length: 2.685 }; var obj = { 0: 12, 1: 11, 2: 9, length: 2.685 };
Array.prototype.reduceRight.call(obj, callbackfn, 1); Array.prototype.reduceRight.call(obj, callbackfn, 1);
return testResult1 && testResult2;
} assert(testResult1, 'testResult1 !== true');
runTestCase(testcase); assert(testResult2, 'testResult2 !== true');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-25
description: > description: >
Array.prototype.reduceRight - value of 'length' is a negative Array.prototype.reduceRight - value of 'length' is a negative
non-integer non-integer
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult1 = true; var testResult1 = true;
var testResult2 = false; var testResult2 = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -32,6 +29,6 @@ function testcase() {
}; };
Array.prototype.reduceRight.call(obj, callbackfn, 1); Array.prototype.reduceRight.call(obj, callbackfn, 1);
return testResult1 && !testResult2;
} assert(testResult1, 'testResult1 !== true');
runTestCase(testcase); assert.sameValue(testResult2, false, 'testResult2');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-3
description: > description: >
Array.prototype.reduceRight - value of 'length' is a number (value Array.prototype.reduceRight - value of 'length' is a number (value
is 0) is 0)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -19,6 +16,5 @@ function testcase() {
var obj = { 0: 9, length: 0 }; var obj = { 0: 9, length: 0 };
return Array.prototype.reduceRight.call(obj, callbackfn, 1) === 1 && !accessed; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), 1, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)');
} assert.sameValue(accessed, false, 'accessed');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-4
description: > description: >
Array.prototype.reduceRight - value of 'length' is a number (value Array.prototype.reduceRight - value of 'length' is a number (value
is +0) is +0)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -19,6 +16,5 @@ function testcase() {
var obj = { 0: 9, length: +0 }; var obj = { 0: 9, length: +0 };
return Array.prototype.reduceRight.call(obj, callbackfn, 1) === 1 && !accessed; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), 1, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)');
} assert.sameValue(accessed, false, 'accessed');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-5
description: > description: >
Array.prototype.reduceRight - value of 'length' is a number (value Array.prototype.reduceRight - value of 'length' is a number (value
is -0) is -0)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(preVal, curVal, idx, obj) { function callbackfn(preVal, curVal, idx, obj) {
@ -19,6 +16,5 @@ function testcase() {
var obj = { 0: 9, length: -0 }; var obj = { 0: 9, length: -0 };
return Array.prototype.reduceRight.call(obj, callbackfn, 1) === 1 && !accessed; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), 1, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)');
} assert.sameValue(accessed, false, 'accessed');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-6
description: > description: >
Array.prototype.reduceRight - value of 'length' is a number (value Array.prototype.reduceRight - value of 'length' is a number (value
is positive) is positive)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult1 = true; var testResult1 = true;
var testResult2 = false; var testResult2 = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -27,6 +24,6 @@ function testcase() {
var obj = { 1: 11, 2: 9, length: 2 }; var obj = { 1: 11, 2: 9, length: 2 };
Array.prototype.reduceRight.call(obj, callbackfn, 1); Array.prototype.reduceRight.call(obj, callbackfn, 1);
return testResult1 && testResult2;
} assert(testResult1, 'testResult1 !== true');
runTestCase(testcase); assert(testResult2, 'testResult2 !== true');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-7
description: > description: >
Array.prototype.reduceRight - value of 'length' is a number (value Array.prototype.reduceRight - value of 'length' is a number (value
is negative) is negative)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult1 = true; var testResult1 = true;
var testResult2 = false; var testResult2 = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -27,6 +24,6 @@ function testcase() {
var obj = { 1: 11, 2: 9, length: -4294967294 }; var obj = { 1: 11, 2: 9, length: -4294967294 };
Array.prototype.reduceRight.call(obj, callbackfn, 1); Array.prototype.reduceRight.call(obj, callbackfn, 1);
return testResult1 && !testResult2;
} assert(testResult1, 'testResult1 !== true');
runTestCase(testcase); assert.sameValue(testResult2, false, 'testResult2');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-3-9
description: > description: >
Array.prototype.reduceRight - value of 'length' is a number (value Array.prototype.reduceRight - value of 'length' is a number (value
is -Infinity) is -Infinity)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -19,6 +16,5 @@ function testcase() {
var obj = { 0: 9, length: -Infinity }; var obj = { 0: 9, length: -Infinity };
return Array.prototype.reduceRight.call(obj, callbackfn, 1) === 1 && !accessed; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 1), 1, 'Array.prototype.reduceRight.call(obj, callbackfn, 1)');
} assert.sameValue(accessed, false, 'accessed');
runTestCase(testcase);

View File

@ -4,17 +4,12 @@
/*--- /*---
es5id: 15.4.4.22-4-12 es5id: 15.4.4.22-4-12
description: Array.prototype.reduceRight - 'callbackfn' is a function description: Array.prototype.reduceRight - 'callbackfn' is a function
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var initialValue = 0; var initialValue = 0;
function callbackfn(accum, val, idx, obj) { function callbackfn(accum, val, idx, obj) {
accum += val; accum += val;
return accum; return accum;
} }
return 20 === [11, 9].reduceRight(callbackfn, initialValue); assert.sameValue([11, 9].reduceRight(callbackfn, initialValue), 20, '[11, 9].reduceRight(callbackfn, initialValue)');
}
runTestCase(testcase);

View File

@ -6,10 +6,8 @@ es5id: 15.4.4.22-8-b-2
description: > description: >
Array.prototype.reduceRight - modifications to length don't change Array.prototype.reduceRight - modifications to length don't change
number of iterations in step 9 number of iterations in step 9
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var called = 0; var called = 0;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
called++; called++;
@ -27,6 +25,5 @@ function testcase() {
var preVal = arr.reduceRight(callbackfn); var preVal = arr.reduceRight(callbackfn);
return preVal === 11 && called === 2; assert.sameValue(preVal, 11, 'preVal');
} assert.sameValue(called, 2, 'called');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-3
description: > description: >
Array.prototype.reduceRight - while loop is breaken once Array.prototype.reduceRight - while loop is breaken once
'kPresent' is true 'kPresent' is true
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var called = 0; var called = 0;
var testResult = false; var testResult = false;
var firstCalled = 0; var firstCalled = 0;
@ -43,6 +40,6 @@ function testcase() {
arr.reduceRight(callbackfn); arr.reduceRight(callbackfn);
return testResult && firstCalled === 1 && secondCalled === 1; assert(testResult, 'testResult !== true');
} assert.sameValue(firstCalled, 1, 'firstCalled');
runTestCase(testcase); assert.sameValue(secondCalled, 1, 'secondCalled');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-ii-1
description: > description: >
Array.prototype.reduceRight - added properties in step 2 are Array.prototype.reduceRight - added properties in step 2 are
visible here visible here
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var obj = {}; var obj = {};
function callbackfn(prevVal, curVal, idx, obj) { } function callbackfn(prevVal, curVal, idx, obj) { }
@ -23,6 +20,4 @@ function testcase() {
configurable: true configurable: true
}); });
return Array.prototype.reduceRight.call(obj, callbackfn) === "accumulator"; assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn), "accumulator", 'Array.prototype.reduceRight.call(obj, callbackfn)');
}
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-1
description: > description: >
Array.prototype.reduceRight - element to be retrieved is own data Array.prototype.reduceRight - element to be retrieved is own data
property on an Array-like object property on an Array-like object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 0) { if (idx === 0) {
@ -21,6 +18,5 @@ function testcase() {
var obj = { 0: 0, 1: 1, length: 2 }; var obj = { 0: 0, 1: 1, length: 2 };
Array.prototype.reduceRight.call(obj, callbackfn); Array.prototype.reduceRight.call(obj, callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,10 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-10
description: > description: >
Array.prototype.reduceRight - element to be retrieved is own Array.prototype.reduceRight - element to be retrieved is own
accessor property on an Array accessor property on an Array
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 2) { if (idx === 2) {
@ -27,6 +25,5 @@ function testcase() {
}); });
arr.reduceRight(callbackfn); arr.reduceRight(callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Array.prototype.reduceRight - element to be retrieved is own Array.prototype.reduceRight - element to be retrieved is own
accessor property that overrides an inherited data property on an accessor property that overrides an inherited data property on an
Array-like object Array-like object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -35,6 +32,5 @@ function testcase() {
}); });
Array.prototype.reduceRight.call(child, callbackfn); Array.prototype.reduceRight.call(child, callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Array.prototype.reduceRight - element to be retrieved is own Array.prototype.reduceRight - element to be retrieved is own
accessor property that overrides an inherited accessor property on accessor property that overrides an inherited accessor property on
an Array-like object an Array-like object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -42,6 +39,5 @@ function testcase() {
}); });
Array.prototype.reduceRight.call(child, callbackfn); Array.prototype.reduceRight.call(child, callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-15
description: > description: >
Array.prototype.reduceRight - element to be retrieved is inherited Array.prototype.reduceRight - element to be retrieved is inherited
accessor property on an Array-like object accessor property on an Array-like object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -34,6 +31,5 @@ function testcase() {
child.length = 3; child.length = 3;
Array.prototype.reduceRight.call(child, callbackfn); Array.prototype.reduceRight.call(child, callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-17
description: > description: >
Array.prototype.reduceRight - element to be retrieved is own Array.prototype.reduceRight - element to be retrieved is own
accessor property without a get function on an Array-like object accessor property without a get function on an Array-like object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -26,6 +23,5 @@ function testcase() {
}); });
Array.prototype.reduceRight.call(obj, callbackfn); Array.prototype.reduceRight.call(obj, callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-18
description: > description: >
Array.prototype.reduceRight - element to be retrieved is own Array.prototype.reduceRight - element to be retrieved is own
accessor property without a get function on an Array accessor property without a get function on an Array
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -26,7 +23,5 @@ function testcase() {
}); });
arr.reduceRight(callbackfn); arr.reduceRight(callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-2
description: > description: >
Array.prototype.reduceRight - element to be retrieved is own data Array.prototype.reduceRight - element to be retrieved is own data
property on an Array property on an Array
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -21,6 +18,5 @@ function testcase() {
var arr = [0, 1, 2]; var arr = [0, 1, 2];
arr.reduceRight(callbackfn); arr.reduceRight(callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-21
description: > description: >
Array.prototype.reduceRight - element to be retrieved is inherited Array.prototype.reduceRight - element to be retrieved is inherited
accessor property without a get function on an Array-like object accessor property without a get function on an Array-like object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -32,7 +29,5 @@ function testcase() {
child.length = 3; child.length = 3;
Array.prototype.reduceRight.call(child, callbackfn); Array.prototype.reduceRight.call(child, callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Array.prototype.reduceRight - This object is the Arguments object Array.prototype.reduceRight - This object is the Arguments object
which implements its own property get method (number of arguments which implements its own property get method (number of arguments
is less than number of parameters) is less than number of parameters)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 0) { if (idx === 0) {
@ -24,6 +21,5 @@ function testcase() {
}; };
func(0, 1); func(0, 1);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Array.prototype.reduceRight - This object is the Arguments object Array.prototype.reduceRight - This object is the Arguments object
which implements its own property get method (number of arguments which implements its own property get method (number of arguments
equals number of parameters) equals number of parameters)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -24,6 +21,5 @@ function testcase() {
}; };
func(0, 1, 2); func(0, 1, 2);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Array.prototype.reduceRight - This object is the Arguments object Array.prototype.reduceRight - This object is the Arguments object
which implements its own property get method (number of arguments which implements its own property get method (number of arguments
is greater than number of parameters) is greater than number of parameters)
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 2) { if (idx === 2) {
@ -24,6 +21,5 @@ function testcase() {
}; };
func(0, 1, 2, 3); func(0, 1, 2, 3);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-28
description: > description: >
Array.prototype.reduceRight applied to String object, which Array.prototype.reduceRight applied to String object, which
implements its own property get method implements its own property get method
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -21,7 +18,5 @@ function testcase() {
var str = new String("012"); var str = new String("012");
Array.prototype.reduceRight.call(str, callbackfn); Array.prototype.reduceRight.call(str, callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-29
description: > description: >
Array.prototype.reduceRight applied to Function object which Array.prototype.reduceRight applied to Function object which
implements its own property get method implements its own property get method
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -27,7 +24,5 @@ function testcase() {
obj[2] = 2; obj[2] = 2;
Array.prototype.reduceRight.call(obj, callbackfn); Array.prototype.reduceRight.call(obj, callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Array.prototype.reduceRight - element to be retrieved is own data Array.prototype.reduceRight - element to be retrieved is own data
property that overrides an inherited data property on an property that overrides an inherited data property on an
Array-like object Array-like object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -29,7 +26,5 @@ function testcase() {
child.length = 3; child.length = 3;
Array.prototype.reduceRight.call(child, callbackfn); Array.prototype.reduceRight.call(child, callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,10 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-30
description: > description: >
Array.prototype.reduceRight - element changed by getter on current Array.prototype.reduceRight - element changed by getter on current
iteration is observed in subsequent iterations on an Array iteration is observed in subsequent iterations on an Array
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -40,6 +38,5 @@ function testcase() {
}); });
arr.reduceRight(callbackfn); arr.reduceRight(callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,10 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-31
description: > description: >
Array.prototype.reduceRight - element changed by getter on current Array.prototype.reduceRight - element changed by getter on current
iteration is observed subsequetly on an Array-like object iteration is observed subsequetly on an Array-like object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -40,6 +38,5 @@ function testcase() {
}); });
Array.prototype.reduceRight.call(obj, callbackfn); Array.prototype.reduceRight.call(obj, callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Array.prototype.reduceRight - element to be retrieved is own data Array.prototype.reduceRight - element to be retrieved is own data
property that overrides an inherited accessor property on an property that overrides an inherited accessor property on an
Array-like object Array-like object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -41,6 +38,5 @@ function testcase() {
}); });
Array.prototype.reduceRight.call(child, callbackfn); Array.prototype.reduceRight.call(child, callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-7
description: > description: >
Array.prototype.reduceRight - element to be retrieved is inherited Array.prototype.reduceRight - element to be retrieved is inherited
data property on an Array-like object data property on an Array-like object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -25,6 +22,5 @@ function testcase() {
var child = new Con(); var child = new Con();
Array.prototype.reduceRight.call(child, callbackfn); Array.prototype.reduceRight.call(child, callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-9
description: > description: >
Array.prototype.reduceRight - element to be retrieved is own Array.prototype.reduceRight - element to be retrieved is own
accessor property on an Array-like object accessor property on an Array-like object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) { if (idx === 1) {
@ -27,7 +24,5 @@ function testcase() {
}); });
Array.prototype.reduceRight.call(obj, callbackfn); Array.prototype.reduceRight.call(obj, callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -8,10 +8,8 @@ description: >
index is larger than array original length added to array after it index is larger than array original length added to array after it
is called, consider new elements which index is smaller than array is called, consider new elements which index is smaller than array
length length
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
arr[5] = 6; arr[5] = 6;
arr[2] = 3; arr[2] = 3;
@ -19,6 +17,5 @@ function testcase() {
} }
var arr = ['1', 2, , 4, '5']; var arr = ['1', 2, , 4, '5'];
return arr.reduceRight(callbackfn) === "54321";
} assert.sameValue(arr.reduceRight(callbackfn), "54321", 'arr.reduceRight(callbackfn)');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-2
description: > description: >
Array.prototype.reduceRight considers new value of elements in Array.prototype.reduceRight considers new value of elements in
array after it is called array after it is called
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function callbackfn(prevVal, curVal, idx, obj) function callbackfn(prevVal, curVal, idx, obj)
{ {
arr[3] = -2; arr[3] = -2;
@ -19,8 +16,5 @@ function testcase() {
} }
var arr = [1,2,3,4,5]; var arr = [1,2,3,4,5];
if(arr.reduceRight(callbackfn) === 13)
return true;
} assert.sameValue(arr.reduceRight(callbackfn), 13, 'arr.reduceRight(callbackfn)');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-4
description: > description: >
Array.prototype.reduceRight doesn't consider unvisited deleted Array.prototype.reduceRight doesn't consider unvisited deleted
elements when Array.length is decreased elements when Array.length is decreased
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function callbackfn(prevVal, curVal, idx, obj) function callbackfn(prevVal, curVal, idx, obj)
{ {
arr.length = 2; arr.length = 2;
@ -18,8 +15,5 @@ function testcase() {
} }
var arr = [1,2,3,4,5]; var arr = [1,2,3,4,5];
if(arr.reduceRight(callbackfn) === 12 )
return true;
} assert.sameValue(arr.reduceRight(callbackfn), 12, 'arr.reduceRight(callbackfn)');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-5
description: > description: >
Array.prototype.reduceRight - callbackfn not called for array with Array.prototype.reduceRight - callbackfn not called for array with
one element one element
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var callCnt = 0; var callCnt = 0;
function callbackfn(prevVal, curVal, idx, obj) function callbackfn(prevVal, curVal, idx, obj)
{ {
@ -19,7 +16,6 @@ function testcase() {
} }
var arr = [1]; var arr = [1];
if(arr.reduceRight(callbackfn) === 1 && callCnt === 0 )
return true; assert.sameValue(arr.reduceRight(callbackfn), 1, 'arr.reduceRight(callbackfn)');
} assert.sameValue(callCnt, 0, 'callCnt');
runTestCase(testcase);

View File

@ -6,10 +6,8 @@ es5id: 15.4.4.22-9-7
description: > description: >
Array.prototype.reduceRight not affect call when the array is Array.prototype.reduceRight not affect call when the array is
deleted during the call deleted during the call
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
delete o.arr; delete o.arr;
return prevVal + curVal; return prevVal + curVal;
@ -17,6 +15,6 @@ function testcase() {
var o = new Object(); var o = new Object();
o.arr = ['1', 2, 3, 4, 5]; o.arr = ['1', 2, 3, 4, 5];
return o.arr.reduceRight(callbackfn) === "141" && !o.hasOwnProperty("arr");
} assert.sameValue(o.arr.reduceRight(callbackfn), "141", 'o.arr.reduceRight(callbackfn)');
runTestCase(testcase); assert.sameValue(o.hasOwnProperty("arr"), false, 'o.hasOwnProperty("arr")');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-8
description: > description: >
Array.prototype.reduceRight - no observable effects occur if 'len' Array.prototype.reduceRight - no observable effects occur if 'len'
is 0 is 0
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
function callbackfn() { function callbackfn() {
accessed = true; accessed = true;
@ -27,6 +24,5 @@ function testcase() {
}); });
Array.prototype.reduceRight.call(obj, function () { }, "initialValue"); Array.prototype.reduceRight.call(obj, function () { }, "initialValue");
return !accessed;
} assert.sameValue(accessed, false, 'accessed');
runTestCase(testcase);

View File

@ -6,10 +6,8 @@ es5id: 15.4.4.22-9-9
description: > description: >
Array.prototype.reduceRight - modifications to length will change Array.prototype.reduceRight - modifications to length will change
number of iterations number of iterations
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var called = 0; var called = 0;
function callbackfn(preVal, val, idx, obj) { function callbackfn(preVal, val, idx, obj) {
called++; called++;
@ -25,6 +23,4 @@ function testcase() {
arr.reduceRight(callbackfn, "initialValue"); arr.reduceRight(callbackfn, "initialValue");
return called === 3; assert.sameValue(called, 3, 'called');
}
runTestCase(testcase);

View File

@ -6,18 +6,13 @@ es5id: 15.4.4.22-9-b-1
description: > description: >
Array.prototype.reduceRight returns initialvalue when Array is Array.prototype.reduceRight returns initialvalue when Array is
empty and initialValue is not present empty and initialValue is not present
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
function callbackfn(prevVal, curVal, idx, obj) function callbackfn(prevVal, curVal, idx, obj)
{ {
} }
var arr = new Array(10); var arr = new Array(10);
if(arr.reduceRight(callbackfn,5) === 5)
return true; assert.sameValue(arr.reduceRight(callbackfn,5), 5, 'arr.reduceRight(callbackfn,5)');
}
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-14
description: > description: >
Array.prototype.reduceRight - decreasing length of array in step 8 Array.prototype.reduceRight - decreasing length of array in step 8
causes deleted index property not to be visited causes deleted index property not to be visited
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var testResult = true; var testResult = true;
@ -33,6 +30,5 @@ function testcase() {
arr.reduceRight(callbackfn); arr.reduceRight(callbackfn);
return testResult && accessed; assert(testResult, 'testResult !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Array.prototype.reduceRight - decreasing length of array in step 8 Array.prototype.reduceRight - decreasing length of array in step 8
does not delete non-configurable properties does not delete non-configurable properties
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -39,6 +36,4 @@ function testcase() {
arr.reduceRight(callbackfn); arr.reduceRight(callbackfn);
return testResult; assert(testResult, 'testResult !== true');
}
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-17
description: > description: >
Array.prototype.reduceRight - properties added into own object are Array.prototype.reduceRight - properties added into own object are
visited on an Array-like object visited on an Array-like object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -35,6 +32,5 @@ function testcase() {
}); });
Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); Array.prototype.reduceRight.call(obj, callbackfn, "initialValue");
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-18
description: > description: >
Array.prototype.reduceRight - properties added into own object are Array.prototype.reduceRight - properties added into own object are
visited on an Array visited on an Array
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -35,6 +32,5 @@ function testcase() {
}); });
arr.reduceRight(callbackfn, "initialValue"); arr.reduceRight(callbackfn, "initialValue");
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-2
description: > description: >
Array.prototype.reduceRight - added properties in step 2 are Array.prototype.reduceRight - added properties in step 2 are
visible here visible here
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -31,6 +28,4 @@ function testcase() {
Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); Array.prototype.reduceRight.call(obj, callbackfn, "initialValue");
return testResult; assert(testResult, 'testResult !== true');
}
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-21
description: > description: >
Array.prototype.reduceRight - deleting own property causes deleted Array.prototype.reduceRight - deleting own property causes deleted
index property not to be visited on an Array-like object index property not to be visited on an Array-like object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var testResult = true; var testResult = true;
@ -39,6 +36,6 @@ function testcase() {
}); });
Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); Array.prototype.reduceRight.call(obj, callbackfn, "initialValue");
return testResult && accessed;
} assert(testResult, 'testResult !== true');
runTestCase(testcase); assert(accessed, 'accessed !== true');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-22
description: > description: >
Array.prototype.reduceRight - deleting own property causes deleted Array.prototype.reduceRight - deleting own property causes deleted
index property not to be visited on an Array index property not to be visited on an Array
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var testResult = true; var testResult = true;
@ -39,6 +36,6 @@ function testcase() {
}); });
arr.reduceRight(callbackfn, "initialValue"); arr.reduceRight(callbackfn, "initialValue");
return testResult && accessed;
} assert(testResult, 'testResult !== true');
runTestCase(testcase); assert(accessed, 'accessed !== true');

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-27
description: > description: >
Array.prototype.reduceRight - decreasing length of array causes Array.prototype.reduceRight - decreasing length of array causes
deleted index property not to be visited deleted index property not to be visited
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var testResult = true; var testResult = true;
@ -33,6 +30,5 @@ function testcase() {
arr.reduceRight(callbackfn, "initialValue"); arr.reduceRight(callbackfn, "initialValue");
return testResult && accessed; assert(testResult, 'testResult !== true');
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

@ -7,11 +7,8 @@ description: >
Array.prototype.reduceRight - decreasing length of array does not Array.prototype.reduceRight - decreasing length of array does not
delete non-configurable properties delete non-configurable properties
flags: [noStrict] flags: [noStrict]
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) { function callbackfn(prevVal, curVal, idx, obj) {
@ -39,6 +36,4 @@ function testcase() {
arr.reduceRight(callbackfn, "initialValue"); arr.reduceRight(callbackfn, "initialValue");
return testResult; assert(testResult, 'testResult !== true');
}
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-3
description: > description: >
Array.prototype.reduceRight - deleted properties in step 2 are Array.prototype.reduceRight - deleted properties in step 2 are
visible here visible here
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var testResult = true; var testResult = true;
@ -33,6 +30,5 @@ function testcase() {
Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); Array.prototype.reduceRight.call(obj, callbackfn, "initialValue");
return accessed && testResult; assert(accessed, 'accessed !== true');
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-4
description: > description: >
Array.prototype.reduceRight - properties added into own object in Array.prototype.reduceRight - properties added into own object in
step 8 can be visited on an Array-like object step 8 can be visited on an Array-like object
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(preVal, curVal, idx, obj) { function callbackfn(preVal, curVal, idx, obj) {
@ -35,6 +32,5 @@ function testcase() {
}); });
Array.prototype.reduceRight.call(obj, callbackfn); Array.prototype.reduceRight.call(obj, callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

View File

@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-5
description: > description: >
Array.prototype.reduceRight - properties added into own object in Array.prototype.reduceRight - properties added into own object in
step 8 can be visited on an Array step 8 can be visited on an Array
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var testResult = false; var testResult = false;
function callbackfn(preVal, curVal, idx, obj) { function callbackfn(preVal, curVal, idx, obj) {
@ -35,6 +32,5 @@ function testcase() {
}); });
arr.reduceRight(callbackfn); arr.reduceRight(callbackfn);
return testResult;
} assert(testResult, 'testResult !== true');
runTestCase(testcase);

Some files were not shown because too many files have changed in this diff Show More