woggles
woggles

Reputation: 7444

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.

Upvotes: 6

Views: 604

Answers (1)

Patrick Lee Scott
Patrick Lee Scott

Reputation: 8699

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.

Upvotes: 2

Related Questions