Browse Source

In strict mode code, functions can only be declared at top level or immediately within another function.

Ivan Pogorelov 6 years ago
parent
commit
0e2ac7f0b8
2 changed files with 12 additions and 12 deletions
  1. 6 6
      js/dependencyLibs/inputmask.dependencyLib.js
  2. 6 6
      js/inputmask.js

+ 6 - 6
js/dependencyLibs/inputmask.dependencyLib.js

@@ -87,7 +87,7 @@
                 var eventRegistry = this[0].eventRegistry,
                     elem = this[0];
 
-                function addEvent(ev, namespace) {
+                var addEvent = function (ev, namespace) {
                     //register domevent
                     if (elem.addEventListener) { // all browsers except IE before version 9
                         elem.addEventListener(ev, handler, false);
@@ -97,7 +97,7 @@
                     eventRegistry[ev] = eventRegistry[ev] || {};
                     eventRegistry[ev][namespace] = eventRegistry[ev][namespace] || [];
                     eventRegistry[ev][namespace].push(handler);
-                }
+                };
 
                 var _events = events.split(" ");
                 for (var endx = 0; endx < _events.length; endx++) {
@@ -114,7 +114,7 @@
                 var eventRegistry = this[0].eventRegistry,
                     elem = this[0];
 
-                function removeEvent(ev, namespace, handler) {
+                var removeEvent = function (ev, namespace, handler) {
                     if (ev in eventRegistry === true) {
                         //unbind to dom events
                         if (elem.removeEventListener) { // all browsers except IE before version 9
@@ -130,9 +130,9 @@
                             eventRegistry[ev][namespace].splice(eventRegistry[ev][namespace].indexOf(handler), 1);
                         }
                     }
-                }
+                };
 
-                function resolveNamespace(ev, namespace) {
+                var resolveNamespace = function (ev, namespace) {
                     var evts = [],
                         hndx, hndL;
                     if (ev.length > 0) {
@@ -176,7 +176,7 @@
                     }
 
                     return evts;
-                }
+                };
 
                 var _events = events.split(" ");
                 for (var endx = 0; endx < _events.length; endx++) {

+ 6 - 6
js/inputmask.js

@@ -135,7 +135,7 @@ Inputmask.prototype = {
             if (opts.importDataAttributes === true) {
                 var attrOptions = npt.getAttribute(dataAttribute), option, dataoptions, optionData, p;
 
-                function importOption(option, optionData) {
+                var importOption = function (option, optionData) {
                     optionData = optionData !== undefined ? optionData : npt.getAttribute(dataAttribute + "-" + option);
                     if (optionData !== null) {
                         if (typeof optionData === "string") {
@@ -145,7 +145,7 @@ Inputmask.prototype = {
                         }
                         userOptions[option] = optionData;
                     }
-                }
+                };
 
                 if (attrOptions && attrOptions !== "") {
                     attrOptions = attrOptions.replace(/'/g, '"');
@@ -575,13 +575,13 @@ Inputmask.prototype = {
                     break;
                 case opts.alternatormarker:
 
-                function groupQuantifier(matches) {
+                var groupQuantifier = function (matches) {
                     var lastMatch = matches.pop();
                     if (lastMatch.isQuantifier) {
                         lastMatch = groupify([matches.pop(), lastMatch]);
                     }
                     return lastMatch;
-                }
+                };
 
                     if (openenings.length > 0) {
                         currentOpeningToken = openenings[openenings.length - 1];
@@ -838,7 +838,7 @@ function maskScope(actionObj, maskset, opts) {
         originalPlaceholder;
 
     //maskset helperfunctions
-    function getMaskTemplate(baseOnInput, minimalPos, includeMode, noJit, clearOptionalTail) {
+    var getMaskTemplate = function (baseOnInput, minimalPos, includeMode, noJit, clearOptionalTail) {
         //includeMode true => input, undefined => placeholder, false => mask
 
         var greedy = opts.greedy;
@@ -883,7 +883,7 @@ function maskScope(actionObj, maskset, opts) {
 
         opts.greedy = greedy;
         return maskTemplate;
-    }
+    };
 
     function getMaskSet() {
         return maskset;