[Webkit-unassigned] [Bug 11401] Drosera doesn't understand object.method = function() {} syntax

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 24 19:14:54 PDT 2006


http://bugs.webkit.org/show_bug.cgi?id=11401





------- Comment #2 from jhurshman at gmail.com  2006-10-24 19:14 PDT -------
I agree, it is tricky. For what it's worth, here's what I've gathered from my
observation of other debugging environments, based on this example:

      function SomeObject() { }     
      function SomeObject2() { }

      SomeObject.methodA = function() { 
        var a = "A"; 
      };

      var tempMethod = function() {
        var b = "B";
      };

      SomeObject.prototype.methodB = tempMethod;
      SomeObject.prototype.methodC = SomeObject.methodA;
      SomeObject2.prototype.methodD = SomeObject.prototype.methodB;

      function test() {
        var a = new SomeObject();
        var b = new SomeObject2();
        SomeObject.methodA();
        a.methodC();
        a.methodB();
        b.methodD();

      }

Venkman labels functions with the name of what the function literal is
originally assigned to. For this example, Venkman lists two methods labeled
"methodA" and "tempMethod", both in the function list and in the call stack.

Firebug just goes with "anonymous", like Drosera currently does. I don't have a
Windows machine handy to test Visual Studio's debugger.

Not knowing anything about how Drosera does its thing, I don't know how this
would work, but it seems to me that the ideal solution would go beyond
Venkman's. It would be great if it would show both the
constructor-name-of-'this' and the callee name, as well as referencing the name
and context of the original name.

Maybe something along the lines of:

SomeObject.methodA
SomeObject.prototype.methodC -> SomeObject.methodA
SomeObject.prototype.methodB -> window.tempMethod
SomeObject2.prototype.methodD -> window.tempMethod

That's getting a bit verbose, but I don't think it would cause confusion.

I must say that I have done heavy-duty JavaScript/AJAX development using
Venkman for several years, and I have never once been confused by their
function labels. So that solution, while not ideal, appears to me to be
adequate.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list