-
Notifications
You must be signed in to change notification settings - Fork 253
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
fix: make inspect for ObjectId work #412
Conversation
The previous `Object.defineProperty()` calls did not work because they did not specify a property descriptor, and even if they had worked, the signatures of `.inspect()` and `.toString()` would have mismatched, and even if they weren’t, the result would not have been very useful as debugging output, because it only returned the raw hex content of the `ObjectId` and not even e.g. the fact that this object is an `ObjectId`. I’m happy with any other solution, but this particular one would make my life a tiny bit easier :)
@addaleax thanks! Yes, can you please open a JIRA ticket a well? That will help us make better release notes |
@mbroadst Neal already did that for me :) https://jira.mongodb.org/browse/NODE-2875 I wasn’t sure whether that was necessary/helpful but I’ll open tickets for everything in the future 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@mbroadst Not sure if your re-approval is a hint for me to merge this, because if so, I have to tell you that I can’t :) |
@addaleax thanks for the bump. I actually want to make sure we have at least two approvals from the team before changes are merged, we'll take care of merging for you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
The previous
Object.defineProperty()
calls did not work becausethey did not specify a property descriptor, and even if they had
worked, the signatures of
.inspect()
and.toString()
wouldhave mismatched, and even if they weren’t, the result would not
have been very useful as debugging output, because it only returned
the raw hex content of the
ObjectId
and not even e.g. the factthat this object is an
ObjectId
.I’m happy with any other solution, but this particular one would
make my life a tiny bit easier :)
Description
Make the
inspect
and[util.inspect.custom]
methods onObjectId
work.Not sure if I should open a JIRA ticket for this, but happy to do so if it helps :)