Permalink
Browse files

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

  • Loading branch information...
savetheclocktower committed Apr 4, 2013
1 parent b07fd94 commit faa0ba932ed9d62a5476a6e62d87069e5ef884b4
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/prototype/dom/dom.js
View
@@ -2336,9 +2336,12 @@
}
var PROBLEMATIC_ATTRIBUTE_READING = (function() {
- DIV.setAttribute('onclick', Prototype.emptyFunction);
+ // This test used to set 'onclick' to `Prototype.emptyFunction`, but that
+ // caused an (uncatchable) error in IE 10. For some reason, switching to
+ // an empty array prevents this issue.
+ DIV.setAttribute('onclick', []);
var value = DIV.getAttribute('onclick');
- var isFunction = (typeof value === 'function');
+ var isFunction = Object.isArray(value);
DIV.removeAttribute('onclick');
return isFunction;
})();

0 comments on commit faa0ba9

Please sign in to comment.