Browse Source

debugger: remove 'repl' command from builtinLibs

* It was displaying useless warning
v0.9.1-release
Fedor Indutny 13 years ago
parent
commit
b6cb6ce0d3
  1. 3
      lib/_debugger.js
  2. 6
      lib/repl.js

3
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);

6
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();

Loading…
Cancel
Save