(element)
| 129 | } |
| 130 | |
| 131 | function stripCommentsFromElement(element) { |
| 132 | if (element instanceof jqLite) { |
| 133 | switch (element.length) { |
| 134 | case 0: |
| 135 | return element; |
| 136 | break; |
| 137 | |
| 138 | case 1: |
| 139 | // there is no point of stripping anything if the element |
| 140 | // is the only element within the jqLite wrapper. |
| 141 | // (it's important that we retain the element instance.) |
| 142 | if (element[0].nodeType === ELEMENT_NODE) { |
| 143 | return element; |
| 144 | } |
| 145 | break; |
| 146 | |
| 147 | default: |
| 148 | return jqLite(extractElementNode(element)); |
| 149 | break; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | if (element.nodeType === ELEMENT_NODE) { |
| 154 | return jqLite(element); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | function extractElementNode(element) { |
| 159 | if (!element[0]) return element; |
no test coverage detected