MCPcopy
hub / github.com/jquery/jquery / assert

Function assert

test/data/jquery-3.7.1.js:978–995  ·  view source on GitHub ↗

* Support testing using an element * @param {Function} fn Passed the created element and returns a boolean result

( fn )

Source from the content-addressed store, hash-verified

976 * @param {Function} fn Passed the created element and returns a boolean result
977 */
978function assert( fn ) {
979 var el = document.createElement( "fieldset" );
980
981 try {
982 return !!fn( el );
983 } catch ( e ) {
984 return false;
985 } finally {
986
987 // Remove from its parent by default
988 if ( el.parentNode ) {
989 el.parentNode.removeChild( el );
990 }
991
992 // release memory in IE
993 el = null;
994 }
995}
996
997/**
998 * Returns a function to use in pseudos for input types

Callers 6

setDocumentFunction · 0.85
jquery-3.7.1.jsFile · 0.85
ensureJQueryFunction · 0.85
ensureJQueryFunction · 0.85

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected