[英]Is there a way to pause a stuck script in the chrome debugger?
Occasionally, while programming JavaScript, I will make a bone headed mistake and can get the page stuck in an infinite loop while it is loading. 有时,在编写JavaScript时,我会犯一个严重的错误,并可能导致页面在加载时陷入无限循环。 I typically will use Chrome for this and, when I get in this state, I cannot do anything with the javascript developer tools.
我通常会为此使用Chrome,当我进入这种状态时,我将无法使用javascript开发人员工具执行任何操作。 What I would really like is a break command similar to what can be done within Visual Studio's debugger that will pause the interpreter and display the current line being executed along with the call stack.
我真正想要的是一个break命令,类似于Visual Studio调试器中可以执行的操作,该命令将暂停解释器并显示当前正在执行的行以及调用堆栈。 Is there any such functionality available.
是否有任何可用的此类功能。
As an alternative to this, I would be handy to set break points in the code. 作为替代方案,我将很方便在代码中设置断点。 Regardless, I need some way to interrupt the process so that I can determine the cause of the lock-up.
无论如何,我都需要某种方法来中断该过程,以便确定锁定的原因。
you can add a debugger;
您可以添加
debugger;
statement somewhere in your code where you want to break execution and continue stepping from there on with the Step Next, Step Over, etc 语句在代码中您想中断执行并继续执行下一步,继续执行等的地方
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.