Fix feature detection for IE
operator `!` has higher precedence (4) than operator `in` (8). Parentheses are mandatory here.
This commit is contained in:
parent
ad1ffc5e95
commit
b35658b1ff
@ -209,7 +209,7 @@
|
||||
var addEventListener;
|
||||
|
||||
var el = document.createElement('div');
|
||||
if (!'addEventListener' in el) {
|
||||
if (!('addEventListener' in el)) {
|
||||
addEventListener = function (element, eventName, callback) {
|
||||
element.attachEvent('on' + eventName, callback);
|
||||
};
|
||||
|
Reference in New Issue
Block a user