Fix Array.prototype.reduce and reduceRight (#3487)
Don't throw TypeError when object length is 0 and initialValue is undefined. Additionally the error message should be more precise and match other engines. Fixes #3463 JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
This commit is contained in:
committed by
Robert Fancsik
parent
40b38f70ef
commit
9e0709e401
@@ -39,6 +39,8 @@ catch(e) {
|
||||
// various checks
|
||||
assert ([].reduce(func, 1) === 1);
|
||||
|
||||
assert ([].reduce(func, undefined) === undefined);
|
||||
|
||||
assert ([0].reduce(func) === 0);
|
||||
|
||||
assert ([0, 1].reduce(func) === 1);
|
||||
|
||||
Reference in New Issue
Block a user