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

Add Classeditor.jssetTimeout. Fix some broken timeouts.

This commit is contained in:
Kris Maglione
2009-11-11 19:18:04 -05:00
parent 5523b04604
commit b607764012
6 changed files with 28 additions and 32 deletions

View File

@@ -8,19 +8,6 @@ const Ci = Components.interfaces;
const Cr = Components.results;
const Cu = Components.utils;
// TODO: Move to liberator.
function setTimeout(callback, timeout, self) {
function target() {
try {
callback.call(self);
}
catch (e) {
liberator.reportError(e);
}
}
return window.setTimeout(target, timeout);
}
function array(obj) {
if (isgenerator(obj))
obj = [k for (k in obj)];
@@ -288,7 +275,14 @@ function Class() {
Class.toString = function () "[class " + this.constructor.name + "]",
Class.prototype = {
init: function() {},
toString: function () "[instance " + this.constructor.name + "]",
setTimeout: function (callback, timeout) {
const self = this;
function target() callback.call(self);
return window.setTimeout(target, timeout);
}
};
const Struct = Class("Struct", {