The bug does not occur with Java 7. I suspected a Java 8 regression but after further investigation I think this a "feature". Java 8 introduced a new JavaScript engine, called Nashorn:
It is a strict implementation of ECMAScript Edition 5.1 and does not include any feature appeared with ECMAScript 6.
return [ true, new Date(date.getFullYear() + holiday_ends_next_year, holiday[2+h] - 1, holiday[3+h] + 1),
applying_holidays[i].name ];
and that would make Nashorn fail. Is it possible to not use this property and stay strictly compliant to ECMAScript 5.1 ?