![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there a way in Firebug to see what code is in a function? All I can coax out of Firefox is "function()". Same with using Firebug's console.out. IE's debugger just tells me it's an Object {...}. Does anyone know of a way to see the function's code? Getting it into a string and printing that out would be just dandy. I'm not looking for a way to see the source (I know how to do that). I'm changing a function during execution and trying to find a good way to debug the result. I have my code working now, but it would have been a lot easier with a way to see what code the function currently has in it ready to execute. |
#3
| |||
| |||
|
|
timothytoe wrote: Is there a way in Firebug to see what code is in a function? All I can coax out of Firefox is "function()". Same with using Firebug's console.out. IE's debugger just tells me it's an Object {...}. Does anyone know of a way to see the function's code? Getting it into a string and printing that out would be just dandy. I'm not looking for a way to see the source (I know how to do that). I'm changing a function during execution and trying to find a good way to debug the result. I have my code working now, but it would have been a lot easier with a way to see what code the function currently has in it ready to execute. you may try the toString() |
#4
| |||
| |||
|
|
On Mar 10, 10:53 pm, Fritz Schenk <intra... (AT) aol (DOT) com> wrote: timothytoe wrote: Is there a way in Firebug to see what code is in a function? All I can coax out of Firefox is "function()". Same with using Firebug's console.out. IE's debugger just tells me it's an Object {...}. Does anyone know of a way to see the function's code? Getting it into a string and printing that out would be just dandy. I'm not looking for a way to see the source (I know how to do that). I'm changing a function during execution and trying to find a good way to debug the result. I have my code working now, but it would have been a lot easier with a way to see what code the function currently has in it ready to execute. you may try the toString() Why thank you very much. I had tried it before but with the wrong syntax (I didn't realize toString was a function, and I had left the function-call parentheses off. console.log(arguments.callee.toString()); works just fine to show the contents of the current function. Should make metaprogramming less painful for me in the future. By the way, callee is nice, but what I really wanted was arguments.caller, which is nonstandard and unfortunately missing in at least one major browser. I end up doing a lot of passing of callee down to the metafunction. "caller" would make my code a lot easier to read and maintain. Oh well. |
![]() |
| Thread Tools | |
| Display Modes | |
| |