File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -995,22 +995,24 @@ if ( document.documentElement.compareDocumentPosition ) {
995995
996996// Utility function for retreiving the text value of an array of DOM nodes
997997Sizzle . getText = function ( elems ) {
998- var ret = "" , elem ;
998+ var elem , nodeType ,
999+ ret = [ ] ;
9991000
10001001 for ( var i = 0 ; elems [ i ] ; i ++ ) {
10011002 elem = elems [ i ] ;
1003+ nodeType = elem . nodeType ;
10021004
10031005 // Get the text from text nodes and CDATA nodes
1004- if ( elem . nodeType === 3 || elem . nodeType === 4 ) {
1005- ret + = elem . nodeValue ;
1006+ if ( nodeType === 3 || nodeType === 4 ) {
1007+ ret [ ret . length ] = elem . nodeValue ;
10061008
10071009 // Traverse everything else, except comment nodes
1008- } else if ( elem . nodeType !== 8 ) {
1009- ret + = Sizzle . getText ( elem . childNodes ) ;
1010+ } else if ( nodeType !== 8 ) {
1011+ ret [ ret . length ] = Sizzle . getText ( elem . childNodes ) ;
10101012 }
10111013 }
10121014
1013- return ret ;
1015+ return ret . join ( '' ) ;
10141016} ;
10151017
10161018// Check to see if the browser returns elements by name when
You can’t perform that action at this time.
0 commit comments