Skip to content

refactor: avoid direct use of Object.prototype builtins - #6

Open
deepsource-autofix[bot] wants to merge 1 commit into
v1.xfrom
deepsource-autofix-26cd084c
Open

refactor: avoid direct use of Object.prototype builtins#6
deepsource-autofix[bot] wants to merge 1 commit into
v1.xfrom
deepsource-autofix-26cd084c

Conversation

@deepsource-autofix

Copy link
Copy Markdown

Fixes are generated by AI. Review them carefully before applying to your codebase.

This PR replaces direct invocations of built-in methods on objects with safe, unbound references to prevent unexpected behavior when those methods are overridden.

  • Object.prototype builtins should not be used directly: DeepSource flagged the direct use of methods like obj.hasOwnProperty(key) because an object’s own properties can shadow built-ins. We refactored these calls to use Object.prototype.hasOwnProperty.call(obj, key) (or Object.hasOwn(obj, key) where supported) to ensure reliability and security.

**Fixes are generated by AI. Review them carefully before applying to your codebase.**

This PR replaces direct invocations of built-in methods on objects with safe, unbound references to prevent unexpected behavior when those methods are overridden.

- `Object.prototype builtins should not be used directly`: DeepSource flagged the direct use of methods like `obj.hasOwnProperty(key)` because an object’s own properties can shadow built-ins. We refactored these calls to use `Object.prototype.hasOwnProperty.call(obj, key)` (or `Object.hasOwn(obj, key)` where supported) to ensure reliability and security.
@deepsource-io

deepsource-io Bot commented May 28, 2025

Copy link
Copy Markdown

Here's the code health analysis summary for commits 1339402..9478f22. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@deepsource-development

Copy link
Copy Markdown

Here's the code health analysis summary for commits 1339402..9478f22. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ Success
🎯 3 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

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.

0 participants