was.js – Diff between revs 35 and 38
?pathlinks?
Rev 35 | Rev 38 | |||
---|---|---|---|---|
Line 6... | Line 6... | |||
6 | function wasSwitch() { |
6 | function wasSwitch() { |
|
7 | if(arguments.length % 2 !== 0) { |
7 | if(arguments.length % 2 !== 0) { |
|
8 | throw "Pairs of predicates expected for cases"; |
8 | throw "Pairs of predicates expected for cases"; |
|
9 | } |
9 | } |
|
Line 10... | Line 10... | |||
10 | |
10 | |
|
11 | (Array.isArray(arguments[0]) ? arguments[0] : [ arguments[0] ]).forEach((s) => { |
11 | (Array.isArray(arguments[0]) ? arguments[0] : [ arguments[0] ]).forEach(function(s) { |
|
12 | var m = false; |
12 | var m = false; |
|
13 | for(var i = 2; i < arguments.length; i += 2) { |
13 | for(var i = 2; i < arguments.length; i += 2) { |
|
14 | if(!arguments[i](s)) { |
14 | if(!arguments[i](s)) { |
|
15 | continue; |
15 | continue; |