vitch/jquery-methods — pull request #5 by tetsuo13 (2012-05-31 03:27:30+00:00)
Title: Only one var statement per function scope

I use `date.js` as part of a larger project which is later monified using YUI Compressor 2.4.7. When warnings are enabled, YUI Compressor reports several lines in which the `var` statement is repeated within the same function scope.

The command used to replicate warnings:

$ java -jar yuicompressor-2.4.7.jar --type=js --verbose date.js

The warnings given:

```
[WARNING] Try to use a single 'var' statement per scope.
var f=format||Date.format; ---> var <--- d=new Date("01/01/1977");var mLength

[WARNING] Try to use a single 'var' statement per scope.
var d=new Date("01/01/1977"); ---> var <--- mLength=0;var iM=f.indexOf

[WARNING] Try to use a single 'var' statement per scope.
("01/01/1977");var mLength=0; ---> var <--- iM=f.indexOf("mmmm");if

[WARNING] Try to use a single 'var' statement per scope.
(iM>-1){for( ---> var <--- i=0;i var <--- mStr=s.substr(iM,Date.

[WARNING] Try to use a single 'var' statement per scope.
;if(iM>-1){ ---> var <--- mStr=s.substr(iM,3)

[WARNING] The variable mStr has already been declared in the same scope...
if(iM>-1){var ---> mStr <--- =s.substr(iM,3);

[WARNING] Try to use a single 'var' statement per scope.
substr(iM,3);for( ---> var <--- i=0;i i <--- =0;i var <--- iY=f.indexOf("yyyy");if

[WARNING] Try to use a single 'var' statement per scope.
"yy"),2)));} ---> var <--- iD=f.indexOf("dd");if
```

This isn't a critical change and it doesn't change the behavior of the script but makes YUI Compressor happy.