MCPcopy Index your code
hub / github.com/Blogify/Blogify / assert

Function assert

public/assets/assets/scripts/frontend.js:886–901  ·  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

884 * @param {Function} fn Passed the created div and expects a boolean result
885 */
886function assert( fn ) {
887 var div = document.createElement("div");
888
889 try {
890 return !!fn( div );
891 } catch (e) {
892 return false;
893 } finally {
894 // Remove from its parent by default
895 if ( div.parentNode ) {
896 div.parentNode.removeChild( div );
897 }
898 // release memory in IE
899 div = null;
900 }
901}
902
903/**
904 * Adds the same handler for all of the specified attrs

Callers 1

frontend.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected