MCPcopy
hub / github.com/apache/caldera / assert

Function assert

static/jquery/jquery.js:939–954  ·  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

937 * @param {Function} fn Passed the created div and expects a boolean result
938 */
939function assert( fn ) {
940 var div = document.createElement("div");
941
942 try {
943 return !!fn( div );
944 } catch (e) {
945 return false;
946 } finally {
947 // Remove from its parent by default
948 if ( div.parentNode ) {
949 div.parentNode.removeChild( div );
950 }
951 // release memory in IE
952 div = null;
953 }
954}
955
956/**
957 * Adds the same handler for all of the specified attrs

Callers 1

jquery.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected