Skip to content

Commit faa0ba9

Browse files
Fix an issue with a capability check causing an error in IE 10.
1 parent b07fd94 commit faa0ba9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/prototype/dom/dom.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2336,9 +2336,12 @@
23362336
}
23372337

23382338
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', []);
23402343
var value = DIV.getAttribute('onclick');
2341-
var isFunction = (typeof value === 'function');
2344+
var isFunction = Object.isArray(value);
23422345
DIV.removeAttribute('onclick');
23432346
return isFunction;
23442347
})();

0 commit comments

Comments
 (0)