Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-12-23 01:40:28 +0300
committerRyan Dahl <ry@tinyclouds.org>2010-12-30 12:35:11 +0300
commit4e81cf7def7c672b620086323c34010d2718e697 (patch)
tree41e0ba09186d22b156ce654037ec3023a813ef7b /lib
parenta8417c128e0c871c6af03236fa42209dc1977caa (diff)
Debugger client emits ready after recving initial res
Diffstat (limited to 'lib')
-rw-r--r--lib/_debugger.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/_debugger.js b/lib/_debugger.js
index 72af3a5cbc4..25f82e72e1f 100644
--- a/lib/_debugger.js
+++ b/lib/_debugger.js
@@ -19,7 +19,8 @@ function tryConnect() {
c = new Client();
process.stdout.write("connecting...");
- c.connect(exports.port, function () {
+ c.connect(exports.port);
+ c.on('ready', function () {
process.stdout.write("ok\r\n");
startInterface();
});
@@ -141,6 +142,7 @@ Client.prototype._onResponse = function(res) {
if (res.headers.Type == 'connect') {
// do nothing
+ this.emit('ready');
} else if (cb) {
this._reqCallbacks.splice(i, 1);
cb(res.body);