다음 코드를 사용하여 longjohn
을 사용하여 잘못된 스택 추적을 얻고 있습니다. firstfunction
에서 호출되는 setTimeout
을 보여주고 있지만, 실제로는 firstfunction이 실행되기 전에 프로그램이 충돌하고 있습니다.nodejs에서 longjohn을 사용할 때 스택 트레이스가 잘못됨
은 내가 여기에 티켓을 만든 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
내 질문이 그것을 해결하는 방법에 문제가 될 수있는 것입니다.