1
我有一个小样本程序http://pastebin.com/5gFkaPgg,它通过TCP向客户端提供REPL服务。根据文档http://nodejs.org/api/repl.html我已经通过eval函数(第11-13行)正确设置,但回调对象不是一个函数。我在文档中误解了什么?节点REPL评估回调
callback(null,result);
^
TypeError: object is not a function
不能回答我的问题...
根据https://github.com/joyent/node/blob/master/lib/repl.js 签名
function(code, context, file, cb) {
//code
cb(err, result);
}
让我知道如果有更合适的解决方案。
钉住它。 FWIW不正确的文档[已在HEAD中修复](https://github.com/joyent/node/pull/2884)。 –