简体   繁体   English

如何打印所有来电者祖先

[英]How to print all callers ancestors

I am tracing a bug in Javascript, 我正在追踪Javascript中的错误,

And want to know where is the original root cause, 想知道根本原因在哪里,

But the function calls are too deep. 但是函数调用太深了。

I use this way to find the first caller. 我用这种方式找到第一个来电者。 arguments.callee.caller....

How to print all the callers in a time ? 如何一次打印所有呼叫者?

Thanks 谢谢

Either: 或者:

A) Insert a debugger; A)插入debugger; statement on its own line in your JavaScript (at a point where you'd like execution to pause). 语句在JavaScript中单独显示(在您希望暂停执行的位置)。 Open Chrome Dev Tools and reload your page. 打开Chrome开发者工具,然后重新加载页面。

Or: 要么:

B) Open Chrome Dev Tools, select the Sources panel, open the relevant (JS) file, click on a line number to add a breakpoint, and reload your page. B)打开Chrome开发工具,选择“ Sources面板,打开相关(JS)文件,单击行号以添加断点,然后重新加载页面。

And then: 接着:

Inspect values by hovering over them in the upper Sources panel (and clicking the resultant popup to drill down into them) or by clicking them the Scope Variables and Watch Expressions panels on the lower-right. 通过将值悬停在上方的“ Sources面板中(然后单击结果弹出窗口以向下钻取它们)或单击它们的右下角的“ Scope Variables和“ Watch Expressions面板来检查值。

While debugging, you can also insert further breakpoints (the blue pentagons), step into/through/over function calls, and run code-checks in the console. 在调试时,您还可以插入更多的断点(蓝色五边形),进入/通过/遍历函数调用,并在控制台中运行代码检查。

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger https://developer.chrome.com/devtools/docs/javascript-debugging https://www.codeschool.com/courses/discover-devtools https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Statements/debugger https://developer.chrome.com/devtools/docs/javascript-debugging https://www.codeschool。 COM /课程/查询devtools

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM