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:
@@ -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;
|
||||
}
|
||||
}, {
|
||||
|
||||
Reference in New Issue
Block a user