Comment #4 on issue 17356 by aialexiskander: Support displayName to name  
anonymous functions in Developer Tools
http://code.google.com/p/chromium/issues/detail?id=17356

The name inferring does not always work well—especially for constructors,  
which are
important for the heap profiler. displayName should be guaranteed to work.

For instance, what if I do this:
var someObject = My.Class.extend({
    mySubObjectType: My.Class.extend({ some: settings }),
    init: function(){ this.mySubObject = My.Class.create(); }
})

// my.class.create:
create: function(){
     var C = this;
     return new C(arguments); // it does use a function that could have its  
displayName
set
}

SproutCore works something like this. While each class _does_ have its own  
function,
Chrome and v8 are unable to determine their names, so they all come up under
SC.Object or something similar in the heap profiler, making that profiler  
entirely
useless.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

-- 
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs

Reply via email to