Robin Herbots 7 年 前
コミット
7a1d9c7a89
2 ファイル変更4 行追加8 行削除
  1. 3 7
      js/inputmask.js
  2. 1 1
      qunit/tests_regex.js

+ 3 - 7
js/inputmask.js

@@ -1133,6 +1133,9 @@
                                         ndxInitializer = typeof altIndex === "string" ? resolveNdxInitializer(testPos, amndx, loopNdxCnt) || ndxInitializerClone.slice() : ndxInitializerClone.slice();
                                         if (alternateToken.matches[amndx] && handleMatch(alternateToken.matches[amndx], [amndx].concat(loopNdx), quantifierRecurse))
                                             match = true;
+                                        else {
+                                            console.log("unmatched " + testPos + " : " + amndx);
+                                        }
 
                                         maltMatches = matches.slice();
                                         testPos = currentPos;
@@ -1174,13 +1177,6 @@
                                                 malternateMatches.push(altMatch);
                                             }
                                         }
-
-                                        if (match !== true) {
-                                            cacheDependency = undefined;
-                                            if (getMaskSet().validPositions[currentPos - 1] === undefined) {
-                                                break;
-                                            }
-                                        }
                                     }
 
                                     matches = currentMatches.concat(malternateMatches);

+ 1 - 1
qunit/tests_regex.js

@@ -200,7 +200,7 @@ export default function (qunit, $, Inputmask) {
     });
 
     qunit.test("inputmask({ regex: \"([0-9]|[1][0-9]|[2][0-3]?)(\\.(5|25|75))?\" - arame regex 12", function (assert) {
-        var $fixture = $("body");
+        var $fixture = $("#qunit-fixture");
         $fixture.append('<input type="text" id="testmask" />');
         var testmask = document.getElementById("testmask");
         Inputmask({