MCPcopy
hub / github.com/perkeep/perkeep / assert

Function assert

app/publisher/jquery.js:905–920  ·  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

903 * @param {Function} fn Passed the created div and expects a boolean result
904 */
905function 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

Callers 2

jquery.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected