Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 prevent JScript debugging on certain files

Is it possible to prevent the Javascript debugger from stepping into certain files?

I specifically don't want it to break when an exception is thrown in the Jquery JavaScript file:

enter image description here

The same goes for other 3rd party minified files...every time there is a run time error it shows the notification and opens up the file. Breaking execution and opening the minified file doesn't help me find the cause of the error.

like image 605
woggles Avatar asked Jan 06 '12 11:01

woggles


People also ask

How do I disable JavaScript Debugging in Visual Studio?

You can go to Tools > Options > Debugging > General > and then in the right part almost like in the middle of the scroll you'll find the option to enable or disable JavaScript debugging.

How do I disable Debugging in Visual Studio 2010?

You can forcibly break into an application using the Terminate All command from the Debug menu. Select Stop debugging from Debug menu to end a debugging session. You also can stop debugging from the processes window.

How do I set Debug configuration in Visual Studio?

In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).


1 Answers

Something is causing the error, and you probably shouldn't just ignore it.

I'd recommend switching to the debug (unminified) script and figured out what exactly the error is.

Once you have the error, if you can't figure it out, post it on stackoverflow and I'm sure someone will be able to help you out more.

Try running your custom scripts through jslint to see if there are any obvious problems. http://www.jslint.com

Edit: Based on your error, I'd say you are trying to do something with a null value, make sure you check for nulls in your code when it's a possibility that something could be null. You can assign default values like this:

variable = (typeof variable === undefined) ? defaultValueIfNull : variable;

or use the same check with if statements

if (typeof variable !== undefined)
{
    //do stuff
}

And because it's jquery and it says object expected, I'd say you may have a selector that doesn't return any matches, but it could be other things, that's just a guess.

like image 77
Patrick Lee Scott Avatar answered Oct 18 '22 23:10

Patrick Lee Scott