mirror of https://github.com/nodejs/node.git
Use Object.getPrototypeOf() 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. This is also more consistent with the while logic below.pull/22966/head
parent
b15ab5de51
commit
8ec31a3362
|
@ -412,8 +412,8 @@ REPLServer.prototype.complete = function(line) {
|
|||
memberGroups.push(Object.getOwnPropertyNames(obj));
|
||||
}
|
||||
// works for non-objects
|
||||
var p = obj.constructor ? obj.constructor.prototype : null;
|
||||
try {
|
||||
var p = Object.getPrototypeOf(obj);
|
||||
var sentinel = 5;
|
||||
while (p !== null) {
|
||||
memberGroups.push(Object.getOwnPropertyNames(p));
|
||||
|
|
Loading…
Reference in New Issue