mirror of
https://github.com/jquery/jquery.git
synced 2026-02-02 21:15:09 -05:00
Core: Standardize indexOf comparisons
not present: `< 0` present: `> -1` at index: `=== N` Closes gh-1984
This commit is contained in:
@@ -240,7 +240,7 @@ jQuery.event = {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( type.indexOf(".") >= 0 ) {
|
||||
if ( type.indexOf(".") > -1 ) {
|
||||
// Namespaced trigger; create a regexp to match event type in handle()
|
||||
namespaces = type.split(".");
|
||||
type = namespaces.shift();
|
||||
@@ -438,7 +438,7 @@ jQuery.event = {
|
||||
|
||||
if ( matches[ sel ] === undefined ) {
|
||||
matches[ sel ] = handleObj.needsContext ?
|
||||
jQuery( sel, this ).index( cur ) >= 0 :
|
||||
jQuery( sel, this ).index( cur ) > -1 :
|
||||
jQuery.find( sel, this, null, [ cur ] ).length;
|
||||
}
|
||||
if ( matches[ sel ] ) {
|
||||
|
||||
Reference in New Issue
Block a user