From 5829716649a543f2c7e43859e5c0e32491b61198 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 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) {