Visual Studio 2010 prevents JScript debugging for specific files

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

I specifically do not want it to break when an exception is thrown in a jQuery JavaScript file:

enter image description here

The same goes for other third-party mini files ... every time a runtime error occurs, it shows a notification and opens the file. Violation of execution and opening of a miniature file does not help me find the cause of the error.

+6
source share
1 answer

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

I would recommend switching to a debug (unminified) script and understand what kind of error it is.

As soon as you get an error, if you can't figure it out, post it on stackoverflow, and I'm sure someone can help you.

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

Change Based on your mistake, I would say that you are trying to do something with a null value, make sure you check for zeros in the code when it is possible that something can be null. You can set default values ​​as follows:

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

or use the same check with if statements

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

And since it is jquery, and it says the expected object, I would say that you can have a selector that does not return any matches, but these may be other things, this is just an assumption.

+2
source

Source: https://habr.com/ru/post/905303/


All Articles