From 4f588be730548d6a77afffa3ec831bd4a4ff68a6 Mon Sep 17 00:00:00 2001 From: Patrick Browne Date: Thu, 12 Jun 2014 10:42:45 +0200 Subject: [PATCH] style: declare var at top --- moment.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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); -- 2.47.2