MCPcopy
hub / github.com/lihongxun945/gobang / assert

Function assert

lib/jquery-weui/lib/jquery-2.1.4.js:891–906  ·  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

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

Callers 1

jquery-2.1.4.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected