This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fix REPL crash on tabbing 'this.'

Thanks to Tim Becker for pointing this out.
  • Loading branch information...
1 parent 80974dc commit 2fb393a768de8998f1b710e010705bb76b80ddc1 @ry ry committed Oct 1, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/repl.js
View
@@ -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) {

0 comments on commit 2fb393a

Please sign in to comment.