File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 946946
947947 var eventIsFunction = isFunction ( event ) ;
948948 var callback = isFunction ( callbackRaw ) ? callbackRaw : function ( ) { } ;
949+ var eventType = typeof event ;
949950
950- if ( validTypes . indexOf ( typeof event ) < 0 && ! eventIsFunction ) {
951- warn ( eventText + " isn 't a string: " + event ) ;
951+ if ( validTypes . indexOf ( eventType ) < 0 && ! eventIsFunction ) {
952+ warnInFunction ( eventFunctionName , eventText + " can 't be " + eventType ) ;
952953 return callback ( ) ;
953954 }
954955
955956 try {
956957 if ( eventIsFunction ) {
957- event = event ( ) ;
958- if ( validTypes . indexOf ( typeof event ) < 0 ) {
959- warn ( eventText + " function output isn't a string: " + event ) ;
958+ var eventOutput = event ( ) ;
959+ if ( validTypes . indexOf ( typeof eventOutput ) < 0 ) {
960+ warnInFunction (
961+ eventFunctionName ,
962+ event + " returns no string: " + eventOutput
963+ ) ;
960964 return callback ( ) ;
961965 }
962966 }
963967 } catch ( error ) {
964- warn ( errorText + " in your event function: " + error ) ;
968+ warnInFunction ( eventFunctionName , error ) ;
965969 return callback ( ) ;
966970 }
967971
You can’t perform that action at this time.
0 commit comments