Tests: Handle globals in .jshintrc.

(cherry picked from commit 2c43548ac6)
This commit is contained in:
Scott González 2013-03-27 09:40:53 -04:00
parent 14c7525853
commit f9097a6d86

View File

@ -77,7 +77,13 @@ TestHelpers.testJshint = function( module ) {
dataType: "text" dataType: "text"
}) })
).done(function( hintArgs, srcArgs ) { ).done(function( hintArgs, srcArgs ) {
var passed = JSHINT( srcArgs[ 0 ], hintArgs[ 0 ] ), var globals, passed, errors,
jshintrc = hintArgs[ 0 ],
source = srcArgs[ 0 ];
globals = jshintrc.globals || {};
delete jshintrc.globals;
passed = JSHINT( source, jshintrc, globals ),
errors = $.map( JSHINT.errors, function( error ) { errors = $.map( JSHINT.errors, function( error ) {
// JSHINT may report null if there are too many errors // JSHINT may report null if there are too many errors
if ( !error ) { if ( !error ) {