Skip to content

Commit

Permalink
Fix an issue with a capability check causing an error in IE 10.
Browse files Browse the repository at this point in the history
  • Loading branch information
savetheclocktower committed Apr 4, 2013
1 parent b07fd94 commit faa0ba9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/prototype/dom/dom.js
Expand Up @@ -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;
})();
Expand Down

0 comments on commit faa0ba9

Please sign in to comment.