doc: note about custom inspect functions by thefourtheye · Pull Request #2142 · nodejs/node

@thefourtheye

See: #1798

When an Object is printed in REPL, the actual representation can be
overriden by defining inspect method on the objects. This patch
includes a note about the same in the REPL documentation

@mscdex mscdex added doc

Issues and PRs related to the documentations.

repl

Issues and PRs related to the REPL subsystem.

labels

Jul 9, 2015

targos

Choose a reason for hiding this comment

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

... defined an inspect function ...

Choose a reason for hiding this comment

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

Changed it now, thanks :-)

@thefourtheye

See: nodejs#1798

When an Object is printed in REPL, the actual representation can be
overriden by defining `inspect` method on the objects. This patch
includes a note about the same in the REPL documentation

@thefourtheye

Fishrock123

Choose a reason for hiding this comment

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

Maybe remove depth?

Choose a reason for hiding this comment

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

Ah, copy/paste mistake. Thanks :-)

@Fishrock123

@thefourtheye

@thefourtheye

@thefourtheye

cjihrig

Choose a reason for hiding this comment

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

Maybe call this Customizing Object displays in the REPL

@thefourtheye

@thefourtheye

@cjihrig Thanks for the review. I changed the text now. PTAL.

cjihrig

Choose a reason for hiding this comment

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

Period after function

Choose a reason for hiding this comment

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

I just used :. Should this be a .?

@cjihrig

LGTM minus a few comments.

@thefourtheye

cjihrig

Choose a reason for hiding this comment

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

I think either a period or colon should be fine here. I originally said period because your sentence was coming to a finish, but you also have a following code block, so either should be fine.

Choose a reason for hiding this comment

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

Cool, thanks :-)

@thefourtheye

targos

Choose a reason for hiding this comment

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

@thefourtheye

@thefourtheye

Thanks for pointing it out @targos :-) PTAL now.

@targos

Fishrock123

Choose a reason for hiding this comment

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

Should this be referred to as inspect()? I wish we had guidelines for that kind of thing... cc @nodejs/documentation