(source, target)
| 883 | } |
| 884 | } |
| 885 | function isSubsetOf(source, target) { |
| 886 | function expand(pattern) { |
| 887 | var expanded = [], start, end; |
| 888 | for (var i = 0, l = pattern.length; i < l; i++) { |
| 889 | if (pattern.charAt(i) === "-") { |
| 890 | end = pattern.charCodeAt(i + 1); |
| 891 | while (++start < end) expanded.push(String.fromCharCode(start)); |
| 892 | } else { |
| 893 | start = pattern.charCodeAt(i); |
| 894 | expanded.push(pattern.charAt(i)); |
| 895 | } |
| 896 | } |
| 897 | return expanded.join(""); |
| 898 | } |
| 899 | if (opts.regex && source.match.fn !== null && target.match.fn !== null) { |
| 900 | return expand(target.match.def.replace(/[\[\]]/g, "")).indexOf(expand(source.match.def.replace(/[\[\]]/g, ""))) !== -1; |
| 901 | } |
| 902 | return source.match.def === target.match.nativeDef; |
| 903 | } |
| 904 | function staticCanMatchDefinition(source, target) { |
| 905 | var sloc = source.locator.slice(source.alternation).join(""), tloc = target.locator.slice(target.alternation).join(""), canMatch = sloc == tloc; |
| 906 | canMatch = canMatch && source.match.fn === null && target.match.fn !== null ? target.match.fn.test(source.match.def, getMaskSet(), pos, false, opts, false) : false; |
no test coverage detected