Thanks a lot, Jeremy!

Eifion

On 28 Ebrill 2006, at 23:51, Jeremy Kitchen wrote:

On Friday 28 April 2006 15:37, Jeremy Kitchen wrote:
On Friday 28 April 2006 15:25, Eifion wrote:
I'm using prototype 1.4.0 in a big web application I've been working
on for months and today a bug was raised by one of our testers. After
investigation it turns out that something done 0 times will actually
fire once. So, for example, if I had

(0).times( function(i) { alert(i); } );

it'd fire once rather than not at all. Is this a bug in prototype or
the expected behaviour?

bug in prototype.  Give me a few minutes and I'll get you a patch :)

and here it is. The problem was because a do { } while() always runs at least
once.  So I changed it to a while() {} and it solved the problem.

I have a test page here: http://edge.scriptkitchen.com:81/~kitchen/ times.html

-Jeremy

--
Jeremy Kitchen ++ [EMAIL PROTECTED]

http://ipaction.org/ -- defend your rights to fair use
<prototype.js.zerotimes.patch>
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to