jscript: Added infinity and nan handling to str_to_number.