debugger: display array contents in repl
This commit allows all array properties to be printed except for "length". Previously, this filter was applied by checking the type of each property. However, something changed in V8, and array elements started coming through as numeric strings, which stopped them from being displayed. Fixes: https://github.com/nodejs/node/issues/6444 PR-URL: https://github.com/nodejs/node/pull/6448 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
This commit is contained in:
parent
8a87b29034
commit
d2eb935177
@ -548,8 +548,8 @@ Client.prototype.mirrorObject = function(handle, depth, cb) {
|
|||||||
mirrorValue = '[?]';
|
mirrorValue = '[?]';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Array.isArray(mirror) && typeof prop.name !== 'number') {
|
// Skip the 'length' property.
|
||||||
// Skip the 'length' property.
|
if (Array.isArray(mirror) && prop.name === 'length') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,3 +75,7 @@ addTest('for (var i in process.env) delete process.env[i]', []);
|
|||||||
addTest('process.env', [
|
addTest('process.env', [
|
||||||
/\{\}/
|
/\{\}/
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
addTest('arr = [{foo: "bar"}]', [
|
||||||
|
/\[ \{ foo: 'bar' \} \]/
|
||||||
|
]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user