Fix REPL crash on tabbing 'this.'

Thanks to Tim Becker for pointing this out.
This commit is contained in:
Ryan Dahl committed 2010-10-01 16:14:13 -07:00
1 parent 80974dc85b
commit 2fb393a768
1 file changed
+2 -1
+2 -1
View File
@@ -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) {