Skip to content

debugger: display array contents in repl #6448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/_debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,8 @@ Client.prototype.mirrorObject = function(handle, depth, cb) {
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;
}

Expand Down
4 changes: 4 additions & 0 deletions test/debugger/test-debugger-repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,7 @@ addTest('for (var i in process.env) delete process.env[i]', []);
addTest('process.env', [
/\{\}/
]);

addTest('arr = [{foo: "bar"}]', [
/\[ \{ foo: 'bar' \} \]/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: while it's not likely to change, it might be worthwhile making the whitespace in the regex optional, just in case. Something like /\[\s*\{\s*foo\:\s*'bar'\s*\}\s*\]/

]);