(element)
| 111 | } |
| 112 | |
| 113 | function stripCommentsFromElement(element) { |
| 114 | if (element instanceof jqLite) { |
| 115 | switch (element.length) { |
| 116 | case 0: |
| 117 | return element; |
| 118 | |
| 119 | case 1: |
| 120 | // there is no point of stripping anything if the element |
| 121 | // is the only element within the jqLite wrapper. |
| 122 | // (it's important that we retain the element instance.) |
| 123 | if (element[0].nodeType === ELEMENT_NODE) { |
| 124 | return element; |
| 125 | } |
| 126 | break; |
| 127 | |
| 128 | default: |
| 129 | return jqLite(extractElementNode(element)); |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | if (element.nodeType === ELEMENT_NODE) { |
| 134 | return jqLite(element); |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | function extractElementNode(element) { |
| 139 | if (!element[0]) return element; |
no test coverage detected