Skip to content

Commit 2d503b1

Browse files
cjihrigFishrock123
authored andcommitted
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 5fe5fa2 commit 2d503b1

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
@@ -548,8 +548,8 @@ Client.prototype.mirrorObject = function(handle, depth, cb) {
548548
mirrorValue = '[?]';
549549
}
550550

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

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)