According to ES5.1 and ES6, when length of obj is 0 and initialValue(the second parameter) is assigned to be undefined, the method below should return undefined. Only when length is 0 and initialValue is not present, the method should throw an TypeError exception.
version
996bf76
command
jerryscript/build/bin/jerry testcase.js
Test case
var NISLFuzzingFunc = function(){
var func = function(a,b){};
var obj = [];
print(obj.length);
return obj.reduceRight(func, undefined);
};
var NISLCallingResult = NISLFuzzingFunc();
print(NISLCallingResult);
Output
0
TypeError: Initial value cannot be undefined.
Expected output
According to ES5.1 and ES6, when
lengthofobjis 0 andinitialValue(the second parameter) is assigned to beundefined, the method below should return undefined. Only whenlengthis 0 andinitialValueis not present, the method should throw an TypeError exception.version
996bf76
command
jerryscript/build/bin/jerry testcase.jsTest case
Output
Expected output