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-3724): Fix BSONTypeError and BSONError to correctly handle instanceof checks #471

Merged
merged 9 commits into from
Nov 3, 2021

Conversation

gjchong25
Copy link
Contributor

Fixes the constructors for BSONTypeError and TypeError with Object.setPrototypeOf so that instanceof checks pass with both error types. The assertion override for throw in register-bson.ts is removed since it is no longer necessary with the fix. Tests making sure the errors respond properly to instanceof checks, show up with the correct names in the stack trace, and pass in input error messages correctly are added.

@dariakp dariakp merged commit d8f334b into master Nov 3, 2021
@dariakp dariakp deleted the NODE-3724 branch November 3, 2021 20:24
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