From: Patrick Browne Date: Thu, 12 Jun 2014 08:42:45 +0000 (+0200) Subject: style: declare var at top X-Git-Tag: 2.8.0~26^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fpull%2F1708%2Fhead;p=thirdparty%2Fmoment.git style: declare var at top --- diff --git a/moment.js b/moment.js index de222b140..8389cc8f8 100644 --- a/moment.js +++ b/moment.js @@ -1487,18 +1487,12 @@ } 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);