0

I came across well known problem when debugging javascript in Chrome browser, described in this question Why does Chrome debugger think closed local variable is undefined?

The problem described there seems to be caused by the optimization done by v8 engine in Chrome. The workaround mentioned there is not very user (programmer) friendly.

So I was wondering is there some way to completely turn off v8 optimization in Chrome devtools when debugging javascript in my web application?

mlst
  • 2,688
  • 7
  • 27
  • 57
  • If you run Chrome with the `--allow-natives-syntax` there is a function called -> `%NeverOptimizeFunction()`, only problem here is if you then run without the flag your app will fail. So to make this easier you might also like this npm module -> https://www.npmjs.com/package/v8-natives – Keith Jul 24 '19 at 12:12
  • Why do you need to debug variables that are no longer used anywhere? – Bergi Jul 24 '19 at 12:38
  • No, there is no checkbox to disable optimisation. – Bergi Jul 24 '19 at 12:39

0 Answers0