diff --git a/lib/repl.js b/lib/repl.js index 68fc116991..252d52df09 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -412,8 +412,8 @@ REPLServer.prototype.complete = function(line) { memberGroups.push(Object.getOwnPropertyNames(obj)); } // works for non-objects - var p = obj.constructor ? obj.constructor.prototype : null; try { + var p = Object.getPrototypeOf(obj); var sentinel = 5; while (p !== null) { memberGroups.push(Object.getOwnPropertyNames(p));