mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
Fix REPL crash on tabbing 'this.'
Thanks to Tim Becker for pointing this out.
This commit is contained in:
1 parent
80974dc85b
commit
2fb393a768
1 file changed
+2
-1
+2
-1
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user