From b6cb6ce0d329c7b359dea403139c8759d952ea16 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Mon, 19 Mar 2012 22:08:25 +0600 Subject: [PATCH] debugger: remove 'repl' command from builtinLibs * It was displaying useless warning --- lib/_debugger.js | 3 +++ lib/repl.js | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/_debugger.js b/lib/_debugger.js index 9f25059423..17ac52e57d 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -754,6 +754,9 @@ function Interface(stdin, stdout, args) { this.repl = new repl.REPLServer('debug> ', streams, this.controlEval.bind(this), false, true); + // Do not print useless warning + repl._builtinLibs.splice(repl._builtinLibs.indexOf('repl'), 1); + // Kill child process when main process dies this.repl.on('exit', function() { process.exit(0); diff --git a/lib/repl.js b/lib/repl.js index 4ce849a35c..982af76f5e 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -69,7 +69,7 @@ module.paths = require('module')._nodeModulePaths(module.filename); // Can overridden with custom print functions, such as `probe` or `eyes.js` exports.writer = util.inspect; -var builtinLibs = ['assert', 'buffer', 'child_process', 'cluster', +exports._builtinLibs = ['assert', 'buffer', 'child_process', 'cluster', 'crypto', 'dgram', 'dns', 'events', 'fs', 'http', 'https', 'net', 'os', 'path', 'punycode', 'querystring', 'readline', 'repl', 'string_decoder', 'tls', 'tty', 'url', 'util', 'vm', 'zlib']; @@ -181,7 +181,7 @@ function REPLServer(prompt, stream, eval, useGlobal, ignoreUndefined) { // Check if a builtin module name was used and then include it // if there's no conflict. - if (~builtinLibs.indexOf(cmd)) { + if (exports._builtinLibs.indexOf(cmd) !== -1) { var lib = require(cmd); if (cmd in self.context && lib !== self.context[cmd]) { self.outputStream.write('A different "' + cmd + @@ -456,7 +456,7 @@ REPLServer.prototype.complete = function(line, callback) { } if (!subdir) { - completionGroups.push(builtinLibs); + completionGroups.push(exports._builtinLibs); } completionGroupsLoaded();