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

Show the default styles in :highlight, etc.

This commit is contained in:
Kris Maglione
2008-10-31 22:46:34 +00:00
parent d7c5e79cd7
commit f0d258c8fc
7 changed files with 522 additions and 405 deletions

View File

@@ -484,10 +484,23 @@ function Struct()
{
let self = this instanceof arguments.callee ? this : new arguments.callee();
for (let [k, v] in Iterator(Array.slice(arguments)))
self[k] = v;
{
if (v != undefined)
self[k] = v;
}
return self;
}
ConStructor.prototype = self;
ConStructor.defaultValue = function (key, val)
{
let i = args.indexOf(key);
let _i = "_" + i;
ConStructor.prototype.__defineGetter__(i, val);
ConStructor.prototype.__defineSetter__(i, function (val) {
this.__defineGetter__(i, function () this[_i]);
this[_i] = val;
});
};
return self.constructor = ConStructor;
}
@@ -497,7 +510,11 @@ Struct.prototype = {
return this.constructor.apply(null, this.slice());
},
// Iterator over our named members
__iterator__: function () ([v, this[v]] for ([k, v] in this.members))
__iterator__: function ()
{
let self = this;
return ([v, self[v]] for ([k, v] in Iterator(self.members)))
}
}
// Add no-sideeffect array methods. Can't set new Array() as the prototype or