Skip to content

Commit

Permalink
3qualize typeof for good measure.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanve committed Feb 10, 2013
1 parent 7d1ef67 commit 0a37c68
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/isEventSupported.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ define(['ModernizrProto', 'createElement'], function( ModernizrProto, createElem

var isSupported;
if ( !eventName ) { return false; }
if ( !element || typeof element == 'string' ) {
if ( !element || typeof element === 'string' ) {
element = createElement(element || TAGNAMES[eventName] || 'div');
} else if ( typeof element != 'object' ) {
} else if ( typeof element !== 'object' ) {
return false; // `element` was invalid type
}

Expand All @@ -47,7 +47,7 @@ define(['ModernizrProto', 'createElement'], function( ModernizrProto, createElem
}
if ( element.setAttribute && element.removeAttribute ) {
element.setAttribute(eventName, '');
isSupported = typeof element[eventName] == 'function';
isSupported = typeof element[eventName] === 'function';

if ( element[eventName] !== undefined ) {
// If property was created, "remove it" by setting value to `undefined`.
Expand Down

0 comments on commit 0a37c68

Please sign in to comment.