Browse Source

fix for-loops when objects are extented

Robin Herbots 11 years ago
parent
commit
e805e3a396

BIN
dist/jQuery.InputMask.3.0.30.nupkg


+ 3 - 3
dist/jquery.inputmask.bundle.js

@@ -371,7 +371,7 @@
                 var testPositions = getTests(pos, ndxIntlzr, tstPs), testPos;
                 for (var ndx in testPositions) {
                     testPos = testPositions[ndx];
-                    if (opts.greedy || ((testPos["match"].optionality === false || testPos["match"].newBlockMarker === false) && testPos["match"].optionalQuantifier !== true)) {
+                    if (opts.greedy || (testPos["match"] && (testPos["match"].optionality === false || testPos["match"].newBlockMarker === false) && testPos["match"].optionalQuantifier !== true)) {
                         break;
                     }
                 }
@@ -387,7 +387,7 @@
             function positionCanMatchDefinition(pos, def) {
                 var valid = false, tests = getTests(pos);
                 for (var tndx in tests) {
-                    if (tests[tndx]["match"].def == def) {
+                    if (tests[tndx]["match"] && tests[tndx]["match"].def == def) {
                         valid = true;
                         break;
                     }
@@ -727,7 +727,7 @@
                 if ($input.data('_inputmask') && (skipDatepickerCheck === true || !$input.hasClass('hasDatepicker'))) {
                     var umValue = [], vps = getMaskSet()["validPositions"];
                     for (var pndx in vps) {
-                        if (vps[pndx]["match"].fn != null) {
+                        if (vps[pndx]["match"] && vps[pndx]["match"].fn != null) {
                             umValue.push(vps[pndx]["input"]);
                         }
                     }

File diff suppressed because it is too large
+ 6 - 6
dist/jquery.inputmask.bundle.min.js


File diff suppressed because it is too large
+ 55 - 55
dist/min/jquery.inputmask.js


+ 3 - 3
js/jquery.inputmask.js

@@ -371,7 +371,7 @@
                 var testPositions = getTests(pos, ndxIntlzr, tstPs), testPos;
                 for (var ndx in testPositions) {
                     testPos = testPositions[ndx];
-                    if (opts.greedy || ((testPos["match"].optionality === false || testPos["match"].newBlockMarker === false) && testPos["match"].optionalQuantifier !== true)) {
+                    if (opts.greedy || (testPos["match"] && (testPos["match"].optionality === false || testPos["match"].newBlockMarker === false) && testPos["match"].optionalQuantifier !== true)) {
                         break;
                     }
                 }
@@ -387,7 +387,7 @@
             function positionCanMatchDefinition(pos, def) {
                 var valid = false, tests = getTests(pos);
                 for (var tndx in tests) {
-                    if (tests[tndx]["match"].def == def) {
+                    if (tests[tndx]["match"] && tests[tndx]["match"].def == def) {
                         valid = true;
                         break;
                     }
@@ -727,7 +727,7 @@
                 if ($input.data('_inputmask') && (skipDatepickerCheck === true || !$input.hasClass('hasDatepicker'))) {
                     var umValue = [], vps = getMaskSet()["validPositions"];
                     for (var pndx in vps) {
-                        if (vps[pndx]["match"].fn != null) {
+                        if (vps[pndx]["match"] && vps[pndx]["match"].fn != null) {
                             umValue.push(vps[pndx]["input"]);
                         }
                     }