Skip to content
This repository
Browse code

Fix an issue with a capability check causing an error in IE 10.

  • Loading branch information...
commit faa0ba932ed9d62a5476a6e62d87069e5ef884b4 1 parent b07fd94
Andrew Dupont authored April 04, 2013

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. 7  src/prototype/dom/dom.js
7  src/prototype/dom/dom.js
@@ -2336,9 +2336,12 @@
2336 2336
   }
2337 2337
   
2338 2338
   var PROBLEMATIC_ATTRIBUTE_READING = (function() {
2339  
-    DIV.setAttribute('onclick', Prototype.emptyFunction);
  2339
+    // This test used to set 'onclick' to `Prototype.emptyFunction`, but that
  2340
+    // caused an (uncatchable) error in IE 10. For some reason, switching to
  2341
+    // an empty array prevents this issue.
  2342
+    DIV.setAttribute('onclick', []);
2340 2343
     var value = DIV.getAttribute('onclick');
2341  
-    var isFunction = (typeof value === 'function');
  2344
+    var isFunction = Object.isArray(value);
2342 2345
     DIV.removeAttribute('onclick');
2343 2346
     return isFunction;
2344 2347
   })();

0 notes on commit faa0ba9

Please sign in to comment.
Something went wrong with that request. Please try again.