Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add missing semicolon and replace `void 0` with `undef` (having `unde…

…fined` value) — making JSLint happy.
  • Loading branch information...
commit 3ab1b1bbe834ff2d2b508386522ad66c89c31e00 1 parent 6320eda
@kangax authored
Showing with 5 additions and 6 deletions.
  1. +5 −6 isEventSupported.js
View
11 isEventSupported.js
@@ -17,20 +17,19 @@
* `isEventSupported` sets such property to `undefined` value, but can not fully remove it
*
*/
-var isEventSupported = (function(){
+var isEventSupported = (function(undef) {
var TAGNAMES = {
'select':'input','change':'input',
'submit':'form','reset':'form',
'error':'img','load':'img','abort':'img'
- }
+ };
function isEventSupported(eventName, element) {
element = element || document.createElement(TAGNAMES[eventName] || 'div');
eventName = 'on' + eventName;
- // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those
var isSupported = (eventName in element);
if (!isSupported) {
@@ -44,7 +43,7 @@ var isEventSupported = (function(){
// if property was created, "remove it" (by setting value to `undefined`)
if (typeof element[eventName] != 'undefined') {
- element[eventName] = void 0;
+ element[eventName] = undef;
}
element.removeAttribute(eventName);
}
@@ -56,7 +55,7 @@ var isEventSupported = (function(){
return isEventSupported;
})();
-var isEventSupportedWithCache = (function(){
+var isEventSupportedWithCache = (function(undef) {
var TAGNAMES = {
'select':'input','change':'input',
@@ -90,7 +89,7 @@ var isEventSupportedWithCache = (function(){
// if property was created, "remove it" (by setting value to `undefined`)
if (typeof element[eventName] != 'undefined') {
- element[eventName] = void 0;
+ element[eventName] = undef;
}
element.removeAttribute(eventName);
}
Please sign in to comment.
Something went wrong with that request. Please try again.