1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-04 03:25:47 +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

@@ -65,10 +65,7 @@ var Group = Class("Group", {
get builtin() this.modules.contexts.builtinGroups.indexOf(this) >= 0,
}, {
compileFilter: function (patterns, default_ = false) {
if (arguments.length < 2)
default_ = false;
compileFilter: function (patterns, default_=false) {
function siteFilter(uri)
let (match = array.nth(siteFilter.filters, f => f(uri), 0))
match ? match.result : default_;