1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-11 22:45:48 +01:00

Default arguments ftw.

This commit is contained in:
Kris Maglione
2013-09-21 16:57:09 -07:00
parent 25aae2cc99
commit 35784406a0
8 changed files with 14 additions and 30 deletions

View File

@@ -480,11 +480,11 @@ var Option = Class("Option", {
stringlist: function stringlist(k) this.value.indexOf(k) >= 0,
get charlist() this.stringlist,
regexplist: function regexplist(k, default_) {
regexplist: function regexplist(k, default_=null) {
for (let re in values(this.value))
if ((re.test || re).call(re, k))
return re.result;
return arguments.length > 1 ? default_ : null;
return default_;
},
get regexpmap() this.regexplist,
get sitelist() this.regexplist,