MCPcopy Index your code
hub / github.com/JsAaron/jQuery / assert

Function assert

2.0.3/2.0.3.js:1195–1210  ·  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

1193 * @param {Function} fn Passed the created div and expects a boolean result
1194 */
1195 function assert( fn ) {
1196 var div = document.createElement("div");
1197
1198 try {
1199 return !!fn( div );
1200 } catch (e) {
1201 return false;
1202 } finally {
1203 // Remove from its parent by default
1204 if ( div.parentNode ) {
1205 div.parentNode.removeChild( div );
1206 }
1207 // release memory in IE
1208 div = null;
1209 }
1210 }
1211
1212 /**
1213 * Adds the same handler for all of the specified attrs

Callers 1

2.0.3.jsFile · 0.70

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected