Browse Source

Fix REPL crash on tabbing 'this.'

Thanks to Tim Becker for pointing this out.
v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
5829716649
  1. 3
      lib/repl.js

3
lib/repl.js

@ -318,7 +318,8 @@ REPLServer.prototype.complete = function (line) {
if (typeof obj === "object" || typeof obj === "function") { if (typeof obj === "object" || typeof obj === "function") {
memberGroups.push(Object.getOwnPropertyNames(obj)); 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 { try {
var sentinel = 5; var sentinel = 5;
while (p !== null) { while (p !== null) {

Loading…
Cancel
Save