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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(utils): Fix isPlainObject() check for classes #10242

Closed
wants to merge 1 commit into from

Conversation

mydea
Copy link
Member

@mydea mydea commented Jan 18, 2024

Turns it this was just wrong, it incorrectly returned true for class instances 馃槵 not sure if this used to work at some point, but it's very easy to reproduce this... and there were no tests 馃槵 馃樋

@mydea mydea self-assigned this Jan 18, 2024
Copy link
Contributor

size-limit report 馃摝

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 77.55 KB (+0.05% 馃敽)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 68.83 KB (+0.05% 馃敽)
@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped) 72.71 KB (+0.05% 馃敽)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 62.46 KB (+0.05% 馃敽)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 32.83 KB (+0.08% 馃敽)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 31.15 KB (+0.08% 馃敽)
@sentry/browser - Webpack (gzipped) 22.5 KB (+0.11% 馃敽)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 75.14 KB (+0.04% 馃敽)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 66.74 KB (+0.04% 馃敽)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 32.6 KB (+0.07% 馃敽)
@sentry/browser - ES6 CDN Bundle (gzipped) 24.21 KB (+0.11% 馃敽)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 210.35 KB (+0.05% 馃敽)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 98.32 KB (+0.11% 馃敽)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 72.44 KB (+0.14% 馃敽)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 35.64 KB (+0.07% 馃敽)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 69.23 KB (+0.05% 馃敽)
@sentry/react - Webpack (gzipped) 22.55 KB (+0.13% 馃敽)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 85.82 KB (+0.04% 馃敽)
@sentry/nextjs Client - Webpack (gzipped) 49.96 KB (+0.06% 馃敽)
@sentry-internal/feedback - Webpack (gzipped) 17.14 KB (+0.14% 馃敽)

return false;
}

try {
Copy link
Member

Choose a reason for hiding this comment

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

l: let's add a comment why we're looking at the ctor name

@mydea
Copy link
Member Author

mydea commented Jan 18, 2024

OK, actually this has considerable effects, as we are using this "incorrect" behavior in most places - mostly wherever we check exceptions being passed 馃槵 So I guess I'll just fix this in this one place, and then in v8 we can change this behavior and have a new utility for POJO or class instance...

@mydea
Copy link
Member Author

mydea commented Jan 18, 2024

replaced by #10245

@mydea mydea closed this Jan 18, 2024
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.

None yet

2 participants