javascript/lib/core/kirin-webview.js
function (jsName, methodName) {
    return function () {
        var args = slice.call(arguments, 0);
        var i = 0, max, arg, util, id, exportable;
        for (max=args.length; i<max; i++) {
            arg = args[i];
 
            if (arg.kirin_bridgeUtils) {
                util = arg.kirin_bridgeUtils;
                util.fillInDefaults(arg);
                util.validate(arg);

                exportable = util.createExportableObject(arg);
                if (util.hasCallbacks(arg)) {
                    // TODO stash the original object some place where we can use it for callbacks later.
                    id = tokenGenerator(jsName, methodName);
                    exportable.__id = id;
                    nativeAccessibleJavascriptObjects[id] = arg;
                }
                args[i] = exportable;
                
            } else if (typeof arg === 'function') {
                console.error("OMG WE'RE WRAPPING AN ERRANT FUNCTION");
                args[i] = wrapCallback(arg, jsName, methodName);
            }
        }
        args.unshift(jsName + "." + methodName);
        return Native.exec.apply(null, args);
    };
}
function (jsName, methodName) {
    return function () {
        var args = slice.call(arguments, 0);
        var i = 0, max, arg, util, id, exportable;
        for (max=args.length; i<max; i++) {
            arg = args[i];
 
            if (arg.kirin_bridgeUtils) {
                util = arg.kirin_bridgeUtils;
                util.fillInDefaults(arg);
                util.validate(arg);

                exportable = util.createExportableObject(arg);
                if (util.hasCallbacks(arg)) {
                    // TODO stash the original object some place where we can use it for callbacks later.
                    id = tokenGenerator(jsName, methodName);
                    exportable.__id = id;
                    nativeAccessibleJavascriptObjects[id] = arg;
                }
                args[i] = exportable;
                
            } else if (typeof arg === 'function') {
                console.error("OMG WE'RE WRAPPING AN ERRANT FUNCTION");
                args[i] = wrapCallback(arg, jsName, methodName);
            }
        }
        args.unshift(jsName + "." + methodName);
        return Native.exec.apply(null, args);
    };
}
function ( jsName , methodName ) { return function ( ) { var args = slice . call ( arguments , 0 ) ; var i = 0 , max , arg , util , id , exportable ; for ( max = args . length ; i < max ; i ++ ) { arg = args [ i ] ; if ( arg . kirin_bridgeUtils ) { util = arg . kirin_bridgeUtils ; util . fillInDefaults ( arg ) ; util . validate ( arg ) ; exportable = util . createExportableObject ( arg ) ; if ( util . hasCallbacks ( arg ) ) { // TODO stash the original object some place where we can use it for callbacks later. id = tokenGenerator ( jsName , methodName ) ; exportable . __id = id ; nativeAccessibleJavascriptObjects [ id ] = arg ; } args [ i ] = exportable ; } else if ( typeof arg === 'function' ) { console . error ( "OMG WE'RE WRAPPING AN ERRANT FUNCTION" ) ; args [ i ] = wrapCallback ( arg , jsName , methodName ) ; } } args . unshift ( jsName + "." + methodName ) ; return Native . exec . apply ( null , args ) ; } ; }
This is the function call that every call out to native goes through.
This is the function call that every call out to native goes through .