functionArgs:function(fn){//function calls it internally, it's the arguments part of the function
varl=fn.length;
// function calls it internally, it's the arguments part of the function
functionArgs:function(fn){
varargs,
l=fn.length;
if(!l){
return'';
return"";
}
varargs=newArray(l);
args=newArray(l);
while(l--){
args[l]=String.fromCharCode(97+l);//97 is 'a'
// 97 is 'a'
args[l]=String.fromCharCode(97+l);
}
return''+args.join(', ')+'';
return""+args.join(", ")+"";
},
key:quote,//object calls it internally, the key part of an item in a map
functionCode:'[code]',//function calls it internally, it's the content of the function
attribute:quote,//node calls it internally, it's an html attribute value
// object calls it internally, the key part of an item in a map
key:quote,
// function calls it internally, it's the content of the function
functionCode:"[code]",
// node calls it internally, it's an html attribute value
attribute:quote,
string:quote,
date:quote,
regexp:literal,//regex
regexp:literal,
number:literal,
'boolean':literal
},
DOMAttrs:{//attributes to dump from nodes, name=>realName
id:'id',
name:'name',
'class':'className'
"boolean":literal
},
HTML:false,//if true, entities are escaped ( <, >, \t, space and \n )
indentChar:'',//indentation unit
multiline:true//if true, items in a collection, are separated by a \n, else just a space.
// if true, entities are escaped ( <, >, \t, space and \n )
HTML:false,
// indentation unit
indentChar:"",
// if true, items in a collection, are separated by a \n, else just a space.
multiline:true
};
returnjsDump;
}());
// from Sizzle.js
functiongetText(elems){
varret="",elem;
for(vari=0;elems[i];i++){
elem=elems[i];
// Get the text from text nodes and CDATA nodes
if(elem.nodeType===3||elem.nodeType===4){
ret+=elem.nodeValue;
// Traverse everything else, except comment nodes
}elseif(elem.nodeType!==8){
ret+=getText(elem.childNodes);
}
}
returnret;
}
//from jquery.js
// from jquery.js
functioninArray(elem,array){
if(array.indexOf){
returnarray.indexOf(elem);
...
...
@@ -1528,73 +2006,76 @@ function inArray( elem, array ) {
*
* Usage: QUnit.diff(expected, actual)
*
* QUnit.diff("the quick brown fox jumped over", "the quick fox jumps over") == "the quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over"
* QUnit.diff( "the quick brown fox jumped over", "the quick fox jumps over" ) == "the quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over"