MCPcopy Create free account
hub / github.com/JsAaron/jQuery / assert

Function assert

2.0.3/Sizzle.js:330–345  ·  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

328 */
329
330 function assert(fn) {
331 var div = document.createElement("div");
332
333 try {
334 return !!fn(div);
335 } catch (e) {
336 return false;
337 } finally {
338 // Remove from its parent by default
339 if (div.parentNode) {
340 div.parentNode.removeChild(div);
341 }
342 // release memory in IE
343 div = null;
344 }
345 }
346
347 /**
348 * Adds the same handler for all of the specified attrs

Callers 1

Sizzle.jsFile · 0.70

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected