[nodejs] What's the default value of a buffer

2012-12-07 Thread Goddy Zhao
var buf = new Buffer(1); console.log(buf[0]); The above code will print a random value of buf[0], anyone know why the default value of a buffer element is not 0 but a random one, and what's the rule of the value? -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joy

[nodejs] What's the default value for buffer

2012-12-07 Thread Goddy Zhao
var buf = new Buffer[1]; console.log(buf[0]); The above code will print a random value of buf[0], anyone know why the default value of a buffer element is not 0 but a random one, and what's the rule of the value? -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joy

[nodejs] How to debug node itself

2012-09-06 Thread Goddy Zhao
I wanna dive into the node, so I enable --gdb when run the configure script in this way: ./configure --prefix install/path --gdb And then make it. I can use *node app.js* , but when I try to debug it with *gdb node , *there is error like *../src/node_main.cc no such file* * * *Any guys know