don't use global vars

This commit is contained in:
Fedor Indutny 2011-09-22 16:47:01 +07:00 committed by Ryan Dahl
parent 2010071339
commit 78d91ff074

View File

@ -57,9 +57,6 @@ exports.start = function(argv, stdin, stdout) {
};
var args = process.argv.slice(2);
args.unshift('--debug-brk');
//
@ -708,12 +705,13 @@ function SourceInfo(body) {
// This class is the repl-enabled debugger interface which is invoked on
// "node debug"
function Interface(stdin, stdout) {
function Interface(stdin, stdout, args) {
var self = this,
child;
this.stdin = stdin;
this.stdout = stdout;
this.args = args;
var streams = {
stdin: stdin,
@ -1413,7 +1411,7 @@ Interface.prototype.trySpawn = function(cb) {
this.killChild();
this.child = spawn(process.execPath, args);
this.child = spawn(process.execPath, this.args);
this.child.stdout.on('data', this.childPrint.bind(this));
this.child.stderr.on('data', this.childPrint.bind(this));