2
Vote

Tests 15.4.4.21-9-c-ii-4-s and 15.4.4.22-9-c-ii-4-s assert that null should be passed as the this value (should be undefined)

description

The tests 15.4.4.21-9-c-ii-4-s and 15.4.4.22-9-c-ii-4-s assert that null should be passed as the this value to the callback function for reduce and reduceRight. The spec is inconsistent (it says undefined for reduce and null for reduceRight) but in the latest errata it clarifies that both functions should pass undefined as the this value.

comments

paulbartrum wrote Oct 5, 2010 at 11:51 PM

Additionally, the callback function is not marked as strict mode code so "undefined" will be converted to the global object as part of the function call.

jwalden wrote Jan 1, 2011 at 9:41 PM

http://es5conform.codeplex.com/workitem/29141 has a patch that also fixes this, although I believe it's not fixed quite as suggested here.

wrote Feb 15, 2011 at 3:10 AM

wrote Feb 13, 2013 at 2:09 AM