From 2fb393a768de8998f1b710e010705bb76b80ddc1 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 1 Oct 2010 11:31:02 -0700 Subject: [PATCH] Fix REPL crash on tabbing 'this.' Thanks to Tim Becker for pointing this out. --- lib/repl.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/repl.js b/lib/repl.js index e4b8a1797ba..ca4e3d7a2f2 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) {