* Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result
( fn )
| 903 | * @param {Function} fn Passed the created div and expects a boolean result |
| 904 | */ |
| 905 | function assert( fn ) { |
| 906 | var div = document.createElement("div"); |
| 907 | |
| 908 | try { |
| 909 | return !!fn( div ); |
| 910 | } catch (e) { |
| 911 | return false; |
| 912 | } finally { |
| 913 | // Remove from its parent by default |
| 914 | if ( div.parentNode ) { |
| 915 | div.parentNode.removeChild( div ); |
| 916 | } |
| 917 | // release memory in IE |
| 918 | div = null; |
| 919 | } |
| 920 | } |
| 921 | |
| 922 | /** |
| 923 | * Adds the same handler for all of the specified attrs |
no outgoing calls
no test coverage detected