Understanding Unreachable Breakpoints in IE11 F12 Developer Tools

I have a problem that I am trying to debug on our website where a specific javascript procedure was not found. I don’t understand why, but I think that if the F12 Dev tools cannot get the code for any reason, then anything in this script block is inaccessible and will not be executed.

Somewhere I can find an explanation why the code in one block of the script is available, and the other, seemingly identical block is not available?

Accessible and inaccessible code illustration

+5
source share
3 answers

Although I received a reward for the first post, the actual answer is that an error in the second javascript block invalidates the entire block for processing breakpoints.

To diagnose this (if the code is not your own, or you wrote it a long time ago and forgot where you made the changes) is to break each procedure into its own separate block, and then find the block that still fails. Then go through this procedure with a toothed comb to determine the cause of the syntax failure - be careful!

Once I determined the reason (inappropriate semicolon), then the breakpoints were re-enabled for the whole block.

Other reasons may be that the code block is unavailable due to duplicate function names. However, this was not my business, so I did not confirm this as a possible cause of unreachable breakpoints.

0
source

replace language="javascript" or delete language="javascript"

By https://msdn.microsoft.com/en-us/library/ms533940(v=vs.85).aspx for the attribute language.

Javascript

Script is JavaScript.

Please refer this and this

+1
source

It seems that the call to the positionCollectionList () function is returned at the end, and the next code block in your case strDGLabel_ContributingFactors was not enclosed in any function, so it cannot be called or executed, which means that the code is inaccessible.

To make sure you can try the following example

Try to save the code below as an html file and open it in IE, and then try to save the breakpoint on line 8, you will reproduce the problem.

 <html> <script> var te; </script> <script> var test="testing"; return; te="test"; </script> <body> HI </body> </html> 

thanks

-2
source

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


All Articles