REPL returns empty object on enumerating properties on a simple JavaScript type (Number, String, Logical).

We should not to do that.

Issue:
https://github.com/ariya/phantomjs/issues/11622
1.x
Vitaliy Slobodin 2013-09-12 23:24:37 +04:00 committed by Ariya Hidayat
parent fe6a967bad
commit 23df8811a1
1 changed files with 5 additions and 0 deletions

View File

@ -109,6 +109,11 @@ REPL._expResStringifyReplacer = function (k, v) {
// Get all the completions for the object we are going to pretty-print
iarr = REPL._getCompletions(REPL._lastEval);
// nothing to enumerate
if (iarr.length == 0)
return v;
for (i in iarr) {
if (typeof(v[iarr[i]]) !== "undefined") {
// add a reference to this "real" property into the mock object