aki*_*ila 49 javascript firebug javascript-debugger
我是FireBug Debugger的新手,任何人都可以说是什么是步入,步出和退出
And*_*yle 112
想象一下以下代码,它通过以下代码输入main(),现在位于第一行bar:
function main() {
val s = foo();
bar(s);
}
function foo() {
return "hi";
}
function bar(s) {
val t = s + foo(); // Debugger is currently here
return t;
}
Run Code Online (Sandbox Code Playgroud)
然后:
foo调用,然后当前行将成为其中的return "hi";行foo.return t;行(这使您可以快速查看t评估的内容).bar方法的其余部分的执行,并且控制将返回到方法的最后一行main.SLa*_*aks 15
Step Into将导致调试器进入下一个函数调用并在那里中断.
Step Over将告诉调试器执行下一个函数并在之后中断.
Step Out将告诉调试器完成当前函数并在它之后中断.
简短的版本是,step into带你进入当前行调用的函数(假设有一个被调用),step out带你回到你决定step into函数时的位置,然后step over移动到下一行代码.例如:
window.someFunction = function() {
var x = 10; //step over to move to the next line
//step out to return to the line after where 'someFunction()' was called
//step into not available
var y = 20;
return x * y;
};
//set breakpoint here
var x = 7; //step over to execute this line and move to the
//next (step into and step out not available)
x += someFunction(); //step over to move to the next line
//step into to move to someFunction() (above)
//step out not available
alert(x); //step over to display the alert
//step out and (probably) step into not available
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
21352 次 |
| 最近记录: |