(0.5).toFixed(1) is ".5". (0.5).toString() is "0.5" and other browsers return "0.5" for both.
ECMA-262 Section 15.7.4.5 states that: 13. Let k be the number of characters in m. 14. If k > f, go to step 18. We are implementing this by creating an if block containing steps 15-17. Unfortuately, the statement we are using is: if (m.size() < f) { // Execute steps 15-17 } // Step 18... Hence, we are assuming that (k > f) is the same as !(k < f). This is logically not the case. I believe that the correct line is: if (m.size() <= f) { Unfortuately, I'm too tired to create/test a patch now. I will try to attach one later this week.
Created attachment 5468 [details] Patch and test case for 5308 Patch attached. This is basically changing the < to a <=. I also changed m.size() to k in order to make the code read more like the algorithm.
Comment on attachment 5468 [details] Patch and test case for 5308 Looks fine. An even better test case would print "success" or "failure" to be more clear.