1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 09:08:37 +01:00

Factor out unnecessary and potentially problematic use of threadYield in editFieldExternally.

This commit is contained in:
Kris Maglione
2010-12-22 04:33:32 -05:00
parent 35a0917084
commit 9a1d78ee56
3 changed files with 71 additions and 61 deletions

View File

@@ -1230,6 +1230,16 @@ const Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
while (flush === true && mainThread.hasPendingEvents());
},
yieldable: function yieldable(func)
function magic() {
let gen = func.apply(this, arguments);
(function next() {
try {
util.timeout(next, gen.next());
} catch(e if e instanceof StopIteration) {};
})();
},
/**
* Traps errors in the called function, possibly reporting them.
*