After learning about how to print out debug messages using Visual Studio's Tracepoint feature, I was curious to see if it worked in JavaScript files. So far, it does and it doesn't.
If I am editing a .js file in VS 2008, I can click on the margin to create a breakpoint. I can then right-click the breakpoint and select "When Hit" and the dialog comes up to define the action.
I select "Print a Message" and "Continue execution". That way, the breakpoint becomes a tracepoint and prints the message to the output window when the ASP.Net program is running in debug.
This, in itself, is very cool. But, in C# code, I can put variables into the printed message by enclosing them in {}. So I can say "In Function $FUNCTION, x = {x}". When I try to do this with JavaScript tracepoints, no matter what I put in the brackets, it just says "variable is not defined".
Is there any way to print meaningful information other than "You are here" type messages in JavaScript tracepoints?
My intent was to put in timing code that would print to the output console in debug but not have to be commented out for releases.
It does at least kinda support JavaScript because if I use it's builtin variables, like $FUNCTION for the function name it works. Actually I just got it to print "JScript anonymous function" for $FUNCTION, but it was in an anonymous function. If there was a $TIMESTAMP I would be in good shape.