事件:;
¥Event: <inspector-protocol-method>
;
当接收到检查器通知其方法字段设置为 <inspector-protocol-method>
值时触发。
¥Emitted when an inspector notification is received that has its method field set
to the <inspector-protocol-method>
value.
以下代码片段在 'Debugger.paused'
事件上安装了监听器,并在程序执行暂停时(例如通过断点)打印程序暂停的原因:
¥The following snippet installs a listener on the 'Debugger.paused'
event, and prints the reason for program suspension whenever program
execution is suspended (through breakpoints, for example):
session.on('Debugger.paused', ({ params }) => {
console.log(params.hitBreakpoints);
});
// [ '/the/file/that/has/the/breakpoint.js:11:0' ]
警告 不建议在同线程会话中使用断点,请参阅[断点支持][断点支持]。
¥Breakpoints with same-thread session is not recommended, see support of breakpoints.