public/javascripts/yui/profiler/profiler.js
function(name /*:String*/, owner /*:Object*/, registerPrototype /*:Boolean*/) /*:Void*/{
        
            //figure out the function name without namespacing
            var funcName = (name.indexOf(".") > -1 ? 
                    name.substring(name.lastIndexOf(".")+1) : name),
                method,
                prototype;
                
            //if owner isn't an object, try to find it from the name
            if (!lang.isObject(owner)){
                owner = eval(name.substring(0, name.lastIndexOf(".")));
            }
            
            //get the method and prototype
            method = owner[funcName];
            prototype = method.prototype;
            
            //see if the method has already been registered
            if (lang.isFunction(method) && !method.__yuiProfiled){
                
                //replace the function with the profiling one
                owner[funcName] = this.instrument(name, method);
                        
                /*
                 * Store original function information. We store the actual
                 * function as well as the owner and the name used to identify
                 * the function so it can be restored later.
                 */
                container[name].__yuiOwner = owner;
                container[name].__yuiFuncName = funcName;  //overwrite with less-specific name
                 
                //register prototype if necessary
                if (registerPrototype) {            
                    this.registerObject(name + ".prototype", prototype);          
                }
    
            }
        
        }
function(name /*:String*/, owner /*:Object*/, registerPrototype /*:Boolean*/) /*:Void*/{
        
            //figure out the function name without namespacing
            var funcName = (name.indexOf(".") > -1 ? 
                    name.substring(name.lastIndexOf(".")+1) : name),
                method,
                prototype;
                
            //if owner isn't an object, try to find it from the name
            if (!lang.isObject(owner)){
                owner = eval(name.substring(0, name.lastIndexOf(".")));
            }
            
            //get the method and prototype
            method = owner[funcName];
            prototype = method.prototype;
            
            //see if the method has already been registered
            if (lang.isFunction(method) && !method.__yuiProfiled){
                
                //replace the function with the profiling one
                owner[funcName] = this.instrument(name, method);
                        
                /*
                 * Store original function information. We store the actual
                 * function as well as the owner and the name used to identify
                 * the function so it can be restored later.
                 */
                container[name].__yuiOwner = owner;
                container[name].__yuiFuncName = funcName;  //overwrite with less-specific name
                 
                //register prototype if necessary
                if (registerPrototype) {            
                    this.registerObject(name + ".prototype", prototype);          
                }
    
            }
        
        }
function ( name /*:String*/ , owner /*:Object*/ , registerPrototype /*:Boolean*/ ) /*:Void*/ { //figure out the function name without namespacing var funcName = ( name . indexOf ( "." ) > - 1 ? name . substring ( name . lastIndexOf ( "." ) + 1 ) : name ) , method , prototype ; //if owner isn't an object, try to find it from the name if ( ! lang . isObject ( owner ) ) { owner = eval ( name . substring ( 0 , name . lastIndexOf ( "." ) ) ) ; } //get the method and prototype method = owner [ funcName ] ; prototype = method . prototype ; //see if the method has already been registered if ( lang . isFunction ( method ) && ! method . __yuiProfiled ) { //replace the function with the profiling one owner [ funcName ] = this . instrument ( name , method ) ; /*
                 * Store original function information. We store the actual
                 * function as well as the owner and the name used to identify
                 * the function so it can be restored later.
                 */ container [ name ] . __yuiOwner = owner ; container [ name ] . __yuiFuncName = funcName ; //overwrite with less-specific name //register prototype if necessary if ( registerPrototype ) { this . registerObject ( name + ".prototype" , prototype ) ; } } }
Sets up a function for profiling. It essentially overwrites the function with one
that has instrumentation data. This method also creates an entry for the function
in the profile report. The original function is stored on the container object.
@param {String} name The full name of the function including namespacing. This
is the name of the function that is stored in the report.
@param {Object} owner (Optional) The object that owns the function. If the function
isn't global then this argument is required. This could be the namespace that
the function belongs to, such as YAHOO.util.Dom, or the object on which it's
a method.
@param {Boolean} registerPrototype (Optional) Indicates that the prototype should
also be instrumented. Setting to true has the same effect as calling
registerConstructor().
@return {Void}
@method registerFunction
@static
Sets up a function for profiling . It essentially overwrites the function with one that has instrumentation data . This method also creates an entry for the function in the profile report . The original function is stored on the container object .