Skip to content

Commit f249711

Browse files
committed
addEvent: Clean up weird else case.
If neither event model is supported, executing it immediately is not a solution. That'll call it with the wrong arguments, with the wrong context at the wrong time. Removed boolean cast check for elem.attachEvent because... .. jQuery doesn't do it either.
1 parent 49d0831 commit f249711

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

qunit/qunit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,12 +1498,12 @@ function extend( a, b ) {
14981498
* @param {Function} fn
14991499
*/
15001500
function addEvent( elem, type, fn ) {
1501+
// Standards-based browsers
15011502
if ( elem.addEventListener ) {
15021503
elem.addEventListener( type, fn, false );
1503-
} else if ( elem.attachEvent ) {
1504-
elem.attachEvent( "on" + type, fn );
1504+
// IE
15051505
} else {
1506-
fn(); // WTF
1506+
elem.attachEvent( "on" + type, fn );
15071507
}
15081508
}
15091509

0 commit comments

Comments
 (0)