* Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result
( fn )
| 873 | * @param {Function} fn Passed the created div and expects a boolean result |
| 874 | */ |
| 875 | function assert( fn ) { |
| 876 | var div = document.createElement("div"); |
| 877 | |
| 878 | try { |
| 879 | return !!fn( div ); |
| 880 | } catch (e) { |
| 881 | return false; |
| 882 | } finally { |
| 883 | // Remove from its parent by default |
| 884 | if ( div.parentNode ) { |
| 885 | div.parentNode.removeChild( div ); |
| 886 | } |
| 887 | // release memory in IE |
| 888 | div = null; |
| 889 | } |
| 890 | } |
| 891 | |
| 892 | /** |
| 893 | * Adds the same handler for all of the specified attrs |
no outgoing calls
no test coverage detected
searching dependent graphs…