Permalink
Browse files

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

  • Loading branch information...
1 parent c0a9985 commit e16021340dd38895b8c7f310355e3a79881f45ed @TooTallNate committed Apr 21, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/repl.js
View
@@ -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;

0 comments on commit e160213

Please sign in to comment.