repl: use Object.getPrototypeOf on functions for tab complete()

pull/24503/head
Nathan Rajlich 2012-04-21 13:53:49 -07:00
parent c0a9985da7
commit e16021340d
1 changed files with 1 additions and 1 deletions

View File

@ -589,7 +589,7 @@ REPLServer.prototype.complete = function(line, callback) {
try {
var sentinel = 5;
var p;
if (typeof obj == 'object') {
if (typeof obj === 'object' || typeof obj === 'function') {
p = Object.getPrototypeOf(obj);
} else {
p = obj.constructor ? obj.constructor.prototype : null;