Skip to content

An issue of Array.prototype.reduceRight #3463

@YuanWangC

Description

@YuanWangC

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
0
undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions