enyojs/enyo-1.0 — pull request #5 by pcworld (2012-03-06 13:39:17+00:00)
Title: Bugfix: infinite loop in enyo.list.PageStrategy

Original description from: http://forums.enyojs.com/discussion/177/patch-bugfix-infinite-loop-in-enyo-list-pagestrategy

This patch fixes an infinite loop bug of enyo.list.PageStrategy.

You can reproduce this bug e.g. in the stock Messaging app (they use a FlyweightDbList, with bottomUp set to true):
Open a conversation into the right pane. Scroll up so you see white space at the bottom, and hold your finger (do not release it).
When you receive a message from the selected person (i.e. FlyweighDbList#refresh gets called), the infinite loop starts and the JS engine will freeze till the execution stack gets terminated by V8 (you see this in the logs as "JS script execution terminated" and "JS script timeout detected").

That "while (true)" statement is pretty bad design and should be rewritten. However, I've created a patch for this particular one bug [this pull request].