Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make it node 0.6 ready

  • Loading branch information...
commit c61477136918bda992faf3d4a61834ff680af45c 1 parent e1362e2
@fjakobs fjakobs authored
Showing with 22 additions and 9 deletions.
  1. +8 −8 lib/v8debug/NodeSocket.js
  2. +13 −0 lib/v8debug/index.js
  3. +1 −1  package.json
View
16 lib/v8debug/NodeSocket.js
@@ -24,28 +24,28 @@ var NodeSocket = module.exports = function(ip, port) {
// TODO: retrieve retry count from configuration
var connectRetryInterval = 50; // 50 msec
// note: total time for retry: 50msc * 30 = 1.5 sec
-
+
function initStream() {
_self.$stream = new net.Stream();
_self.$stream.setEncoding("utf8");
-
+
_self.$stream.addListener("data", function(data) {
_self.$onData(data);
});
-
+
_self.$stream.addListener("end", onEnd);
_self.$stream.addListener("error", onError);
-
+
_self.$stream.addListener("connect", function () {
// set connection flag to true (connected)
connected = true;
_self.emit("connect");
});
}
-
+
// create the initial connection object
initStream();
-
+
function onEnd(errorInfo) {
// set connection flag to false (not connected)
connected = false;
@@ -53,7 +53,7 @@ var NodeSocket = module.exports = function(ip, port) {
_self.state = "initialized";
_self.emit("end", errorInfo);
}
-
+
function onError() {
// if currently not connected and there re-tries left to perform
if (!connected && connectRetryCount > 0) {
@@ -80,7 +80,7 @@ var NodeSocket = module.exports = function(ip, port) {
this.$port = port;
};
-require("util").inherits(NodeSocket, EventEmitter);
+require("./util").inherits(NodeSocket, EventEmitter);
(function() {
View
13 lib/v8debug/index.js
@@ -0,0 +1,13 @@
+require("amd-loader");
+var fs = require("fs");
+
+fs.readdirSync(__dirname).forEach(function(filename){
+ var m = filename.match(/^([A-Z].*)(Test)?\.js$/);
+
+ if (m && !m[2]) {
+ var name = m[1];
+ exports.__defineGetter__(name, function(){
+ return require("./" + name);
+ });
+ }
+});
View
2  package.json
@@ -6,7 +6,7 @@
"author": "Fabian Jakobs <fabian@ajax.org>",
"main": "lib/v8debug",
"dependencies": {
- "amd-loader": ">=0.0.2"
+ "amd-loader": "~0.0.4"
},
"devDependencies": {
"asyncjs": "0.0.x"
Please sign in to comment.
Something went wrong with that request. Please try again.