Robin Herbots 15 年 前
コミット
dff0410efe
1 ファイル変更2 行追加2 行削除
  1. 2 2
      jquery.inputmask.js

+ 2 - 2
jquery.inputmask.js

@@ -219,7 +219,7 @@ This plugin is based on the masked input plugin written by Josh Bush (digitalbus
             }
 
             if (c) { chrs += c; }
-            var testResult = tests[testPos].regex != null ? tests[testPos].regex.test(chrs) : false;
+            var testResult = tests[testPos].regex.test(chrs);
             return !testResult && tests[testPos].optionality && isFirstMaskOfBlock(testPos) ? isValid(seekNext(pos, true), c, buffer) : testResult;
         }
 
@@ -228,7 +228,7 @@ This plugin is based on the masked input plugin written by Josh Bush (digitalbus
             var test = tests[testPos];
             if (test != undefined && test.optionality && !isFirstMaskOfBlock(testPos)) {
                 var newPos = pos + test.offset;
-                testPos = determineTestPosition(newPos);
+                test = tests[determineTestPosition(newPos)];
             }
             return test != undefined ? test.regex : false;
         }