Sunday, February 6, 2011

Processing.js - Bug# 946

This had to have been the easiest bug to fix. Yay. You can find it here: https://processing-js.lighthouseapp.com/projects/41284/tickets/946-unexpected-result-when-converting-char-to-str

Basically there's a function that takes data and outputs it as a string. The problem was that when you passed it a char, it returned the ASCII value. After going on IRC and learning how to get started, the "bazaar" discovered that one of the tests for this function had been commented out by the person who worked on it last (no wonder it passed).

So basically what I did was uncomment that, add another test that looks exactly the same as the one in the sketchpad link above, and my fix. my fix was exactly this:


--arr.push(val[i] + "");
++arr.push(val[i].toString() + "");
##return arr;
##}
##}
##else
##{
--return (val + "");
++return (val.toString() + "");


... pretty much. It's up for review. If you're reading this, feel free to review it. I put the link to my branch in the comments for the lighthouse link provided (not sure if thats what i was supposed to do).

No comments:

Post a Comment