Commit 3c64f4d2 authored by alexey.musinov's avatar alexey.musinov

mobile js exception

parent f6ecc5f3
...@@ -4683,34 +4683,35 @@ var makeArray = function( array, results ) { ...@@ -4683,34 +4683,35 @@ var makeArray = function( array, results ) {
// converting a NodeList to an array using builtin methods. // converting a NodeList to an array using builtin methods.
// Also verifies that the returned array holds DOM nodes // Also verifies that the returned array holds DOM nodes
// (which is not the case in the Blackberry browser) // (which is not the case in the Blackberry browser)
try { //try {
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; // Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
//
// Provide a fallback method if it does not work //// Provide a fallback method if it does not work
} catch( e ) { //} catch( e ) {
makeArray = function( array, results ) { // makeArray = function( array, results ) {
var i = 0, // var i = 0,
ret = results || []; // ret = results || [];
//
if ( toString.call(array) === "[object Array]" ) { // if ( toString.call(array) === "[object Array]" ) {
Array.prototype.push.apply( ret, array ); // Array.prototype.push.apply( ret, array );
//
} else { // } else {
if ( typeof array.length === "number" ) { // if ( typeof array.length === "number" ) {
for ( var l = array.length; i < l; i++ ) { // for ( var l = array.length; i < l; i++ ) {
ret.push( array[i] ); // ret.push( array[i] );
} // }
//
// } else {
// for ( ; array[i]; i++ ) {
// ret.push( array[i] );
// }
// }
// }
//
// return ret;
// };
//}
} else {
for ( ; array[i]; i++ ) {
ret.push( array[i] );
}
}
}
return ret;
};
}
var sortOrder, siblingCheck; var sortOrder, siblingCheck;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment