Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2389006

Browse filesBrowse files
cjihrigMyles Borins
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 <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
1 parent 52d9e7b commit 2389006
Copy full SHA for 2389006

File tree

Expand file treeCollapse file tree

2 files changed

+6
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-2
lines changed
Open diff view settings
Collapse file

‎lib/_debugger.js‎

Copy file name to clipboardExpand all lines: lib/_debugger.js
+2-2Lines changed: 2 additions & 2 deletions
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

Collapse file

‎test/debugger/test-debugger-repl.js‎

Copy file name to clipboardExpand all lines: test/debugger/test-debugger-repl.js
+4Lines changed: 4 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.