]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
style: declare var at top 1708/head
authorPatrick Browne <patrick.browne@amadeus.com>
Thu, 12 Jun 2014 08:42:45 +0000 (10:42 +0200)
committerPatrick Browne <patrick.browne@amadeus.com>
Thu, 12 Jun 2014 08:42:45 +0000 (10:42 +0200)
moment.js

index de222b140a25808263a0d683224028796595296f..8389cc8f8dbe5650ddca22186050a34e3308bb28 100644 (file)
--- a/moment.js
+++ b/moment.js
     }
 
     function makeDateFromInput(config) {
-        var input = config._i;
+        var input = config._i, matched;
         if (input === undefined) {
             config._d = new Date();
-            return;
         } else if (isDate(input)) {
             config._d = new Date(+input);
-            return;
-        }
-
-        var matched = aspNetJsonRegex.exec(input);
-
-        if (matched) {
+        } else if ( (matched = aspNetJsonRegex.exec(input)) !== null ) {
             config._d = new Date(+matched[1]);
         } else if (typeof input === 'string') {
             makeDateFromString(config);