This happens without longjohn .
I donβt know exactly why, but if you call your callbacks, it works better:
setTimeout(function MyFirstTimeoutCallback() { throw new Error(); }, 10); ...
This creates the following trace:
/private/tmp/node_modules/longjohn/dist/longjohn.js:181 throw e; ^ Error at MyFirstTimeoutCallback (/private/tmp/lj.js:4:9) <-- much better! at listOnTimeout (timers.js:110:15) --------------------------------------------- at Object.<anonymous> (/private/tmp/lj.js:3: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
EDIT: It looks like this error was introduced (somewhere) in Node 0.10. When I test 0.8.23, it looks fine:
timers.js:103 if (!process.listeners('uncaughtException').length) throw e; ^ Error at Object.<anonymous> (/private/tmp/lj.js:4:9) <-- correct at list.ontimeout (timers.js:101:19) ...
( bug report )
EDIT # 2: This is a confirmed bug in V8 (see bug report).
source share