理解Node中console.trace()的输出

时间:2011-12-05 23:37:22

标签: node.js

从命令行输入console.trace()将吐出:

at repl:1:10
at REPLServer.eval (repl.js:80:21)
at Interface.<anonymous> (repl.js:182:12)
at Interface.emit (events.js:67:17)
at Interface._onLine (readline.js:162:10)
at Interface._line (readline.js:426:8)
at Interface._ttyWrite (readline.js:603:14)
at ReadStream.<anonymous> (readline.js:82:12)
at ReadStream.emit (events.js:88:20)
at ReadStream._emitKey (tty.js:309:10)

有人能快速走过这个烂摊子吗?

1 个答案:

答案 0 :(得分:2)

这是您当前堆栈的打印件。显然,您从console.trace() eval()调用的repl.js (line 80, column 20)调用的repl.js line 182调用了events.js (line 67),{{1}}调用了{{1}}调用的脚本等。你必须自上而下阅读。