Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
debugger: remove 'repl' command from builtinLibs
Browse files Browse the repository at this point in the history
* It was displaying useless warning
  • Loading branch information
indutny committed Mar 19, 2012
1 parent f61d4b7 commit b6cb6ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/_debugger.js
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions lib/repl.js
Expand Up @@ -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'];
Expand Down Expand Up @@ -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 +
Expand Down Expand Up @@ -456,7 +456,7 @@ REPLServer.prototype.complete = function(line, callback) {
}

if (!subdir) {
completionGroups.push(builtinLibs);
completionGroups.push(exports._builtinLibs);
}

completionGroupsLoaded();
Expand Down

0 comments on commit b6cb6ce

Please sign in to comment.