|
|
@@ -1099,12 +1099,13 @@ function maskScope(actionObj, maskset, opts) {
|
|
|
match = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx, quantifierRecurse);
|
|
|
if (match) return true;
|
|
|
} else if (match.isOptional) {
|
|
|
- var optionalToken = match;
|
|
|
+ var optionalToken = match, mtchsNdx = matches.length;
|
|
|
match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);
|
|
|
if (match) {
|
|
|
//mark optionality in matches
|
|
|
$.each(matches, function (ndx, mtch) {
|
|
|
- mtch.match.optionality = true;
|
|
|
+ if (ndx >= mtchsNdx)
|
|
|
+ mtch.match.optionality = true;
|
|
|
});
|
|
|
latestMatch = matches[matches.length - 1].match;
|
|
|
if (quantifierRecurse === undefined && isFirstMatch(latestMatch, optionalToken)) { //prevent loop see #698
|
|
|
@@ -1294,7 +1295,6 @@ function maskScope(actionObj, maskset, opts) {
|
|
|
}
|
|
|
}
|
|
|
if (getMaskSet().tests[pos] && getMaskSet().tests[pos][0].cd === cacheDependency) { //cacheDependency is set on all tests, just check on the first
|
|
|
- //console.log("cache hit " + pos + " - " + ndxIntlzr);
|
|
|
return getMaskSet().tests[pos];
|
|
|
}
|
|
|
for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) {
|