1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 08:07:59 +01:00

Do something remotely reasonable where designMode documents are concerned. Some fixes for evalInSandbox problems in recent nightlies.

This commit is contained in:
Kris Maglione
2010-10-24 20:21:14 -04:00
parent 6f95b33694
commit dc38a2208c
8 changed files with 86 additions and 76 deletions

View File

@@ -257,15 +257,15 @@ const Command = Class("Command", {
options: [],
optionMap: Class.memoize(function () array(this.options)
.map(function (opt) opt.names.map(function (name) [name, opt]))
.flatten.toObject()),
.flatten().toObject()),
newArgs: function () {
let res = [];
res.__proto__ = this.argsPrototype;
return res;
},
argsPrototype: Class.memoize(function () update([],
array([opt, opt.default] for (opt in values(this.options)) if (set.has(opt, "default")))
.toObject(),
array(this.options).filter(function (opt) opt.default !== undefined)
.map(function (opt) [opt.names[0], opt.default]).toObject(),
{
__iterator__: function () array.iterItems(this),
command: this,