diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-04-24 07:43:26 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-04-24 07:43:26 -0400 |
commit | 88e141801cbd2d149f98d11f7674f35a9e06e288 (patch) | |
tree | aee0bc40d1d8c3014514f44573f7914556e76eab | |
parent | f3b022ddb8815974f52aeeddb79d209645041653 (diff) | |
download | jquery-ui-88e141801cbd2d149f98d11f7674f35a9e06e288.tar.gz jquery-ui-88e141801cbd2d149f98d11f7674f35a9e06e288.zip |
Tests: Check for null error objects when reporting JSHint errors.
-rw-r--r-- | tests/unit/testsuite.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js index 7e505979c..faef90a9d 100644 --- a/tests/unit/testsuite.js +++ b/tests/unit/testsuite.js @@ -48,6 +48,11 @@ function testJshint( widget ) { ).done(function( hintArgs, srcArgs ) { var passed = JSHINT( srcArgs[ 0 ], hintArgs[ 0 ] ), errors = $.map( JSHINT.errors, function( error ) { + // JSHINT may report null if there are too many errors + if ( !error ) { + return; + } + return "[L" + error.line + ":C" + error.character + "] " + error.reason + "\n" + error.evidence + "\n"; }).join( "\n" ); |