Skip to content

Commit 88e1418

Browse files
committed
Tests: Check for null error objects when reporting JSHint errors.
1 parent f3b022d commit 88e1418

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/unit/testsuite.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ function testJshint( widget ) {
4848
).done(function( hintArgs, srcArgs ) {
4949
var passed = JSHINT( srcArgs[ 0 ], hintArgs[ 0 ] ),
5050
errors = $.map( JSHINT.errors, function( error ) {
51+
// JSHINT may report null if there are too many errors
52+
if ( !error ) {
53+
return;
54+
}
55+
5156
return "[L" + error.line + ":C" + error.character + "] " +
5257
error.reason + "\n" + error.evidence + "\n";
5358
}).join( "\n" );

0 commit comments

Comments
 (0)