1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 07:27:58 +01:00

Resurrect my range finder, Part III: Search highlighting.

This commit is contained in:
Kris Maglione
2009-11-11 06:09:26 -05:00
parent 0f4598fcd6
commit f8ddb3e9c3
3 changed files with 195 additions and 222 deletions

View File

@@ -8,6 +8,19 @@ 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)];
@@ -230,8 +243,9 @@ function Class() {
if (callable(args[0]))
superclass = args.shift();
var Constructor = eval("(function " + (name || superclass.name) +
var Constructor = eval("(function " + (name || superclass.name).replace(/\W/g, "_") +
String.substr(constructor, 20) + ")");
Constructor.name = name || superclass.name;
if (!('init' in superclass.prototype)) {
var superc = superclass;