Some people (me) use __proto__ to augment an Object's prototype after it's been created.
This patch helps make the "new" prototype properties visible if necessary in the REPL's tab completion.
I would attach a test case but I'm not sure how to test for this tab-completion behavior. At least I couldn't find an existing one.
Thanks in advance!
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.
__proto__ is not a part of ECMA262, I think that Object.getPrototypeOf() is better:
var p = Object.getPrototypeOf(obj);
I don't disagree, in fact that was my initial instinct. I wen't with __proto__ because of the comment above this line "works for non-objects". Object.getPrototypeOf() throws on non-objects so I figured that's why that was there.
Though, I couldn't seem to get any tab-completion working on literals anyways, so making it "work for non-objects" might be pointless.
@koichik Here's a perhaps better patch: https://gist.github.com/1165960
Closed by 8ec31a3...