1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-29 00:45:45 +01:00

Add timeout arg to util.waitFor.

--HG--
branch : key-processing
This commit is contained in:
Kris Maglione
2011-01-27 22:14:03 -05:00
parent 7f15781e41
commit abb434ce7c
3 changed files with 5 additions and 6 deletions

View File

@@ -804,9 +804,7 @@ var CompletionContext = Class("CompletionContext", {
* If 0 or null, wait indefinitely.
*/
wait: function wait(interruptable, timeout) {
let end = Date.now() + timeout;
util.waitFor(function () !this.incomplete || (this.timeout && Date.now() > end),
this);
util.waitFor(function () !this.incomplete, this, timeout);
return this.incomplete;
}
}, {