MCPcopy Create free account
hub / github.com/JsAaron/jQuery / assert

Function assert

2.1.1/test/jquery-1.11.1.js:915–930  ·  view source on GitHub ↗

* Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result

( fn )

Source from the content-addressed store, hash-verified

913 * @param {Function} fn Passed the created div and expects a boolean result
914 */
915function assert( fn ) {
916 var div = document.createElement("div");
917
918 try {
919 return !!fn( div );
920 } catch (e) {
921 return false;
922 } finally {
923 // Remove from its parent by default
924 if ( div.parentNode ) {
925 div.parentNode.removeChild( div );
926 }
927 // release memory in IE
928 div = null;
929 }
930}
931
932/**
933 * Adds the same handler for all of the specified attrs

Callers 1

jquery-1.11.1.jsFile · 0.70

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected