Skip to content
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(NODE-4887): serializeInto does not check for the presence of a toBSON method for values in Map entries #555

Conversation

W-A-James
Copy link
Contributor

Description

Adding fix to ensure that values of Maps run are replaced by the result of calling their toBSON method if it exists.

Is there new documentation needed for these changes?

No

What is the motivation for this change?

Ensure that BSON.serialize keeps with spec behaviour

Double check the following

  • Ran npm run lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests

@W-A-James W-A-James force-pushed the NODE-4887/serializeInto_does_not_check_for_toBSON_method_for_map_entries branch from 6deae7c to 6de6fdb Compare January 6, 2023 21:22
@W-A-James W-A-James marked this pull request as ready for review January 6, 2023 21:26
Copy link
Contributor

@baileympearson baileympearson left a comment

Choose a reason for hiding this comment

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

Looks good, one small test wording suggestion. I'm requesting changes for visibility but otherwise LGTM

test/node/to_bson_test.js Outdated Show resolved Hide resolved
Co-authored-by: Bailey Pearson <bailey.pearson@mongodb.com>
@baileympearson baileympearson merged commit ebc1c76 into main Jan 9, 2023
@baileympearson baileympearson deleted the NODE-4887/serializeInto_does_not_check_for_toBSON_method_for_map_entries branch January 9, 2023 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants