src/aria/core/JsObject.js
function (args, commonInfo, interceptorIndex) {
        if (interceptorIndex >= commonInfo.nbInterceptors) {
            // end of recursion: call the real method:
            return this[commonInfo.method].apply(this, args);
        }
        var interc = commonInfo.interceptors[interceptorIndex];
        if (interc.removed) {
            // interceptor was removed in the mean time, skip it.
            return __callWrapper.call(this, info.args, commonInfo, interceptorIndex + 1);
        }
        var info = {
            step : "CallBegin",
            method : commonInfo.method,
            args : args,
            cancelDefault : false,
            returnValue : null
        };
        var asyncCbParam = commonInfo.asyncCbParam;
        if (asyncCbParam != null) {
            var callback = {
                fn : __callbackWrapper,
                scope : this,
                args : {
                    info : info,
                    interc : interc,
                    // save previous callback:
                    origCb : args[asyncCbParam]
                }
            };
            args[asyncCbParam] = callback;
            if (args.length <= asyncCbParam) {
                // We do this check and set the length property because the
                // "args" object comes
                // from the JavaScript arguments object, which is not a real
                // array so that the
                // length property is not updated automatically by the previous
                // assignation: args[asyncCbParam] = callback;
                args.length = asyncCbParam + 1;
            }
            info.callback = callback;
        }
        this.$callback(interc, info);
        if (!info.cancelDefault) {
            // call next wrapper or real method:
            try {
                info.returnValue = __callWrapper.call(this, info.args, commonInfo, interceptorIndex + 1);
            } catch (e) {
                info.exception = e;
            }
            info.step = "CallEnd";
            delete info.cancelDefault; // no longer useful in CallEnd
            // call the interceptor, even if it was removed in the mean time (so
            // that CallEnd is always called when
            // CallBegin has been called):
            this.$callback(interc, info);
            if ("exception" in info) {
                throw info.exception;
            }
        }
        return info.returnValue;
    }
function (args, commonInfo, interceptorIndex) {
        if (interceptorIndex >= commonInfo.nbInterceptors) {
            // end of recursion: call the real method:
            return this[commonInfo.method].apply(this, args);
        }
        var interc = commonInfo.interceptors[interceptorIndex];
        if (interc.removed) {
            // interceptor was removed in the mean time, skip it.
            return __callWrapper.call(this, info.args, commonInfo, interceptorIndex + 1);
        }
        var info = {
            step : "CallBegin",
            method : commonInfo.method,
            args : args,
            cancelDefault : false,
            returnValue : null
        };
        var asyncCbParam = commonInfo.asyncCbParam;
        if (asyncCbParam != null) {
            var callback = {
                fn : __callbackWrapper,
                scope : this,
                args : {
                    info : info,
                    interc : interc,
                    // save previous callback:
                    origCb : args[asyncCbParam]
                }
            };
            args[asyncCbParam] = callback;
            if (args.length <= asyncCbParam) {
                // We do this check and set the length property because the
                // "args" object comes
                // from the JavaScript arguments object, which is not a real
                // array so that the
                // length property is not updated automatically by the previous
                // assignation: args[asyncCbParam] = callback;
                args.length = asyncCbParam + 1;
            }
            info.callback = callback;
        }
        this.$callback(interc, info);
        if (!info.cancelDefault) {
            // call next wrapper or real method:
            try {
                info.returnValue = __callWrapper.call(this, info.args, commonInfo, interceptorIndex + 1);
            } catch (e) {
                info.exception = e;
            }
            info.step = "CallEnd";
            delete info.cancelDefault; // no longer useful in CallEnd
            // call the interceptor, even if it was removed in the mean time (so
            // that CallEnd is always called when
            // CallBegin has been called):
            this.$callback(interc, info);
            if ("exception" in info) {
                throw info.exception;
            }
        }
        return info.returnValue;
    }
function ( args , commonInfo , interceptorIndex ) { if ( interceptorIndex >= commonInfo . nbInterceptors ) { // end of recursion: call the real method: return this [ commonInfo . method ] . apply ( this , args ) ; } var interc = commonInfo . interceptors [ interceptorIndex ] ; if ( interc . removed ) { // interceptor was removed in the mean time, skip it. return __callWrapper . call ( this , info . args , commonInfo , interceptorIndex + 1 ) ; } var info = { step : "CallBegin" , method : commonInfo . method , args : args , cancelDefault : false , returnValue : null } ; var asyncCbParam = commonInfo . asyncCbParam ; if ( asyncCbParam != null ) { var callback = { fn : __callbackWrapper , scope : this , args : { info : info , interc : interc , // save previous callback: origCb : args [ asyncCbParam ] } } ; args [ asyncCbParam ] = callback ; if ( args . length <= asyncCbParam ) { // We do this check and set the length property because the // "args" object comes // from the JavaScript arguments object, which is not a real // array so that the // length property is not updated automatically by the previous // assignation: args[asyncCbParam] = callback; args . length = asyncCbParam + 1 ; } info . callback = callback ; } this . $callback ( interc , info ) ; if ( ! info . cancelDefault ) { // call next wrapper or real method: try { info . returnValue = __callWrapper . call ( this , info . args , commonInfo , interceptorIndex + 1 ) ; } catch ( e ) { info . exception = e ; } info . step = "CallEnd" ; delete info . cancelDefault ; // no longer useful in CallEnd // call the interceptor, even if it was removed in the mean time (so // that CallEnd is always called when // CallBegin has been called): this . $callback ( interc , info ) ; if ( "exception" in info ) { throw info . exception ; } } return info . returnValue ; }
Recursive method to call wrappers. This method should be called with "this" refering to the object whose method
is called.
Recursive method to call wrappers . This method should be called with this refering to the object whose method is called .