Tutorial :How to break Visual Studio 2010 JavaScript debugger from script



Question:

Is there a JavaScript command that will cause the Visual Studio 2010 debugger to break?

Trying break(); didn't work because it's only valid within loops. Also stop(); failed because it picked up that stop() doesn't exist and I didn't have a useful stack trace.


Solution:1

Javascript has a debugger statement, it woks in firebug, so it should in VS 2010 as well.

12.15 The debugger statement

Evaluating the DebuggerStatement production may allow an implementation to cause a breakpoint when run under a debugger. If a debugger is not present or active this statement has no observable effect.

ECMA-262 5th Edition


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »