I have a function source() to show the definitions of functions passed to it
function sourceAsHTML() {
var s=''
for (var i=0; i<arguments.length; i++) {
alert(arguments[i])
s +=
'<PRE>'
+ arguments[i].toString().replace (/</g, '<')
+ '</PRE>'
}
return s
}
and it works nicely, except in the case of a class prototype assigned to an
anonymous function
i.e.
function myClass () {}
function myClass.prototype.foobar = function () { /* foobar */ }
alert (sourceAsHTML(myClass.prototype.foobar))
.....
the alert shows
<PRE>function () { /* foobar */ }</PRE>
which is close, but it doesn't show that it 'belongs' to
myClass.prototype.foobar.
So the question is, when passed a function as an arg is there a way to know
the function name or context (i.e. prototype) ?
--
Richard A. DeVenezia