MCPcopy Create free account
hub / github.com/TruthHun/BookStack / assert

Function assert

static/wangEditor/js/lib/jquery-2.2.1.js:900–915  ·  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

898 * @param {Function} fn Passed the created div and expects a boolean result
899 */
900function assert( fn ) {
901 var div = document.createElement("div");
902
903 try {
904 return !!fn( div );
905 } catch (e) {
906 return false;
907 } finally {
908 // Remove from its parent by default
909 if ( div.parentNode ) {
910 div.parentNode.removeChild( div );
911 }
912 // release memory in IE
913 div = null;
914 }
915}
916
917/**
918 * Adds the same handler for all of the specified attrs

Callers 1

jquery-2.2.1.jsFile · 0.70

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected