longjohn
使用以下代码时,我得到了错误的堆栈跟踪。它显示setTimeout
从 调用firstfunction
,但实际上程序在执行 firstfunction 之前崩溃。
我在这里创建了一张票 https://github.com/mattinsler/longjohn/issues/16
var longjohn = require("longjohn");
setTimeout(function () {
throw new Error();
}, 10);
setTimeout(function () {
firstfunction();
}, 10000);
var firstfunction = function () {
setTimeout(function () {
console.log("First function");
}, 10);
}
堆栈跟踪
/home/jeevan/node_js/node_modules/longjohn/dist/longjohn.js:181
throw e;
^
Error
at firstfunction (/home/jeevan/node_js/longjohn.js:11:11)
at listOnTimeout (timers.js:110:15)
---------------------------------------------
at Object.<anonymous> (/home/jeevan/node_js/longjohn.js:10:1)
at Module._compile (module.js:456:26)
at Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Module._load (module.js:312:12)
at Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
我的问题是可能是什么问题,如何解决它。