0

To debug some concepts I run this in Chrome Console:

what = function(){ 
    let value = 5
    try { 
        wrong(); 
    } catch(e) { 
        console.log('bad'); 
        value += 1
    }
    return value
}
what()
# returns 6

Works as expected, except console.log('bad') never happens.

obviously the fact that value = 6 and not 5 is proof that block is called.

Why does console.log just get skipped in the console? I'm pretty sure I've injected JS into apps where the console.log works so this is probably a setting in the console window itself. Firefox's behavior is the same.

Oliver Williams
  • 5,966
  • 7
  • 36
  • 78

2 Answers2

0

My best guess, since it isn't working on either platform, is that it is an extension that is blocking it -- from another stackoverflow post, it may be firebug lite or you accidentally disabled it through your filters.

If none of this works, I suggest trying out a guest window and seeing if it works there.

I can not reproduce this on my own machine as well as others: Chrome 102.0.5005.61 (Official Build) (64-bit) (cohort: 102_win_control)

LeoDog896
  • 3,472
  • 1
  • 15
  • 40
  • Yes it was as simple as disabling it with the filter which I didn't notice. Sorry to make a post like this when the problem was indeed that obvious – Oliver Williams May 31 '22 at 18:59
0

It is working! Remove the last line and it will work! If it again did not worked then it is might blocking by an extension

Tanishq
  • 1
  • 1
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 01 '22 at 02:42