javascript/jsunit/app/xbDebug.js
function xbDebugApplyFunction(funcname, funcref, thisref, argumentsref)
{
    var rv;

    if (!funcref)
    {
        alert('xbDebugApplyFunction: funcref is null');
    }

    if (typeof(funcref.apply) != 'undefined')
        return funcref.apply(thisref, argumentsref);

    var applyexpr = 'thisref.xbDebug_orig_' + funcname + '(';
    var i;

    for (i = 0; i < argumentsref.length; i++)
    {
        applyexpr += 'argumentsref[' + i + '],';
    }

    if (argumentsref.length > 0)
    {
        applyexpr = applyexpr.substring(0, applyexpr.length - 1);
    }

    applyexpr += ')';

    return eval(applyexpr);
}
function xbDebugApplyFunction(funcname, funcref, thisref, argumentsref)
{
    var rv;

    if (!funcref)
    {
        alert('xbDebugApplyFunction: funcref is null');
    }

    if (typeof(funcref.apply) != 'undefined')
        return funcref.apply(thisref, argumentsref);

    var applyexpr = 'thisref.xbDebug_orig_' + funcname + '(';
    var i;

    for (i = 0; i < argumentsref.length; i++)
    {
        applyexpr += 'argumentsref[' + i + '],';
    }

    if (argumentsref.length > 0)
    {
        applyexpr = applyexpr.substring(0, applyexpr.length - 1);
    }

    applyexpr += ')';

    return eval(applyexpr);
}
function xbDebugApplyFunction ( funcname , funcref , thisref , argumentsref ) { var rv ; if ( ! funcref ) { alert ( 'xbDebugApplyFunction: funcref is null' ) ; } if ( typeof ( funcref . apply ) != 'undefined' ) return funcref . apply ( thisref , argumentsref ) ; var applyexpr = 'thisref.xbDebug_orig_' + funcname + '(' ; var i ; for ( i = 0 ; i < argumentsref . length ; i ++ ) { applyexpr += 'argumentsref[' + i + '],' ; } if ( argumentsref . length > 0 ) { applyexpr = applyexpr . substring ( 0 , applyexpr . length - 1 ) ; } applyexpr += ')' ; return eval ( applyexpr ) ; }
emulate functionref.apply for IE mac and IE win < 5.5
emulate functionref . apply for IE mac and IE win < 5 . 5