Skip to content

Commit 2389006

Browse files
cjihrigMyles Borins
authored and
Myles Borins
committed
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: #6444 PR-URL: #6448 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
1 parent 52d9e7b commit 2389006

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/_debugger.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ Client.prototype.mirrorObject = function(handle, depth, cb) {
547547
mirrorValue = '[?]';
548548
}
549549

550-
if (Array.isArray(mirror) && typeof prop.name !== 'number') {
551-
// Skip the 'length' property.
550+
// Skip the 'length' property.
551+
if (Array.isArray(mirror) && prop.name === 'length') {
552552
return;
553553
}
554554

test/debugger/test-debugger-repl.js

+4
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,7 @@ addTest('for (var i in process.env) delete process.env[i]', []);
7575
addTest('process.env', [
7676
/\{\}/
7777
]);
78+
79+
addTest('arr = [{foo: "bar"}]', [
80+
/\[ \{ foo: 'bar' \} \]/
81+
]);

0 commit comments

Comments
 (0)