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)。 –