diff --git a/lib/repl.js b/lib/repl.js index e4b8a1797b..ca4e3d7a2f 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -318,7 +318,8 @@ REPLServer.prototype.complete = function (line) { if (typeof obj === "object" || typeof obj === "function") { memberGroups.push(Object.getOwnPropertyNames(obj)); } - var p = obj.constructor.prototype; // works for non-objects + // works for non-objects + var p = obj.constructor ? obj.constructor.prototype : null; try { var sentinel = 5; while (p !== null) {