functionArgs:function(fn){//function calls it internally, it's the arguments part of the function
// function calls it internally, it's the arguments part of the function
varl=fn.length;
functionArgs:function(fn){
varargs,
l=fn.length;
if(!l){
if(!l){
return'';
return"";
}
}
varargs=newArray(l);
args=newArray(l);
while(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
// 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
key:quote,
attribute:quote,//node calls it internally, it's an html attribute value
// 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,
string:quote,
date:quote,
date:quote,
regexp:literal,//regex
regexp:literal,
number:literal,
number:literal,
'boolean':literal
"boolean":literal
},
DOMAttrs:{//attributes to dump from nodes, name=>realName
id:'id',
name:'name',
'class':'className'
},
},
HTML:false,//if true, entities are escaped ( <, >, \t, space and \n )
// if true, entities are escaped ( <, >, \t, space and \n )
indentChar:'',//indentation unit
HTML:false,
multiline:true//if true, items in a collection, are separated by a \n, else just a space.
// indentation unit
indentChar:"",
// if true, items in a collection, are separated by a \n, else just a space.
multiline:true
};
};
returnjsDump;
returnjsDump;
}());
}());
// from Sizzle.js
// from jquery.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
functioninArray(elem,array){
functioninArray(elem,array){
if(array.indexOf){
if(array.indexOf){
returnarray.indexOf(elem);
returnarray.indexOf(elem);
...
@@ -1528,73 +2006,76 @@ function inArray( elem, array ) {
...
@@ -1528,73 +2006,76 @@ function inArray( elem, array ) {
*
*
* Usage: QUnit.diff(expected, actual)
* 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"