From 8bf25e78e95f0784a0a889612ee9477340b30b3d Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Mon, 22 Aug 2011 18:24:59 -0700 Subject: [PATCH] Use __proto__ on the object in the REPL tab-completion. Some people use __proto__ to augment an Object's prototype after it's been created. This patch helps make the "new" prototype properties visible if necessary. --- lib/repl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/repl.js b/lib/repl.js index 68fc1169918..3df0d807c9e 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -412,7 +412,7 @@ REPLServer.prototype.complete = function(line) { memberGroups.push(Object.getOwnPropertyNames(obj)); } // works for non-objects - var p = obj.constructor ? obj.constructor.prototype : null; + var p = obj.__proto__; try { var sentinel = 5; while (p !== null) {