In bug 38886, Nicholas Nethercote wrote:
I noticed recently that string-validate-input.js also has this property. Because that benchmark is dominated by string concatenation, a JS engine can over-optimize this benchmark by applying a lazy concatenation approach -- ie. build a tree of to-be-concatenated strings and then concatenate them when needed. Except in this string-validate-input.js the final string is never used so the actual final concatenation step is not needed.
The final string should be used. Printing the whole thing out is a bad idea, it's 420,000 chars and so I/O costs would dominate. Maybe printing out every 1000th char would be ok? That provide a reasonable amount of "use" of the final string so that over-optimizing the benchmark would be difficult. Or computing a really simple hash of the string would be a more thorough use. bitops-bitwise-and.js provides an example of a really simple hash that could be used -- just '&' together every char.