Skip to content

Fix always-false empty array check in _enterComponentEditMode#661

Merged
paulsmirnov merged 1 commit into
mainfrom
639-code-improvement-condition-that-always-give-false
May 27, 2026
Merged

Fix always-false empty array check in _enterComponentEditMode#661
paulsmirnov merged 1 commit into
mainfrom
639-code-improvement-condition-that-always-give-false

Conversation

@paulsmirnov
Copy link
Copy Markdown
Member

Description

Fixes #639.

In JavaScript, comparing two objects with === checks reference identity, not content. A freshly created [] is never the same reference as the editors array, so this condition always evaluated to false and the early return never fired.

Type of changes

  • Bug fix (non-breaking change that fixes an issue)

Checklist

  • I have read CONTRIBUTING and CODE_OF_CONDUCT guides.
  • I have followed the code style of this project.
  • I have run yarn run ci: lint and tests pass locally with my changes.
  • I have added tests that prove my fix/feature works OR The changes do not require updated tests.
  • I have added the necessary documentation OR The changes do not require updated docs.

@paulsmirnov paulsmirnov linked an issue May 26, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Collaborator

@NadezhdaKatcman NadezhdaKatcman 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, thank you!

@paulsmirnov paulsmirnov merged commit e8f9daf into main May 27, 2026
6 checks passed
@paulsmirnov paulsmirnov deleted the 639-code-improvement-condition-that-always-give-false branch May 27, 2026 00:55
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.

Code improvement: condition that always give false

2 participants