QUnit to check for globals
Hi,
QUnit had a feature "noglobals" for some time now, to check for global
variables that are introduced by code a runtime. This is very useful
to find bugs like missing var-keywords. Though so far the feature had
to be manually enabled by putting "?noglobals" in the URL to the
testsuite.
I've commited a change to always check for globals. In my tests that
revealed a few bugs in jQuery core, jQuery UI as well as in my
validation plugin - I fixed each before commiting the change.
Now looking at the testswarm results (http://testswarm.com/job/47/),
there are more issues related to that. It looks like it makes sense to
fix the underlying issues revealed by the change. The message provided
by QUnit makes tracking the issue down rather issue, as it contains
the name of the introduced variable. Based on the test that introduced
the variable, the scope of the search can be reduced a lot.
If you find a false positive, please report that here. If the check
itself turns out to be flawed, we'll try to fix that, otherwise revert
to the optional check (or a per-module option).
Jörn