From faa0ba932ed9d62a5476a6e62d87069e5ef884b4 Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Thu, 4 Apr 2013 18:58:53 -0500 Subject: [PATCH] Fix an issue with a capability check causing an error in IE 10. --- src/prototype/dom/dom.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/prototype/dom/dom.js b/src/prototype/dom/dom.js index 7b72941c5..f97ac77ec 100644 --- a/src/prototype/dom/dom.js +++ b/src/prototype/dom/dom.js @@ -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; })();