[Webkit-unassigned] [Bug 40080] Web Inspector: better Function.prototype.bind for the internal code

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 3 05:20:57 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=40080





--- Comment #8 from Patrick Mueller <pmuellr at yahoo.com>  2010-06-03 05:20:56 PST ---
Using displayName will allow you to see a function name on the call stack in the debugger, in the profiler, and other places.  Not clear if it helps with the toString() output that Nikita originally posted the bug about.  Quick check in WI says it doesn't:

    > var x = function() { }
    undefined

    > x
    function () { }

    > x.displayName = "a_function_called_x"
    "a_function_called_x"

    > x
    function () { }

    > x.toString()
    "function () { }"

But it wouldn't show the "original" function body anyway.

My main objection to the proposed fix is that it's misleading.  The debugger is showing you something which isn't true.  I'd be quite happy if the toString() was implemented like this though:

binded.toString = function toString() {
    return "bound: " + func.toString();
};

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



More information about the webkit-unassigned mailing list