LearnNewsExamplesServices
Frontmatter
id7874
titleRemove duplicate contains() method in Rectangle.mjs
stateClosed
labels
bugairefactoring
assigneestobiu
createdAtNov 23, 2025, 12:07 PM
updatedAtNov 23, 2025, 12:13 PM
githubUrlhttps://github.com/neomjs/neo/issues/7874
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtNov 23, 2025, 12:13 PM

Remove duplicate contains() method in Rectangle.mjs

Closed v11.9.0 bugairefactoring
tobiu
tobiu commented on Nov 23, 2025, 12:07 PM

Description The contains method in src/util/Rectangle.mjs is defined twice.

  1. Once with inline logic.
  2. Once delegating to this.constructor.includes.

This causes code duplication and confusion.

Proposed Change

  1. Remove the duplicate definition (the inline one).
  2. Update the remaining contains method to explicitly use Rectangle.includes(this, other) instead of this.constructor.includes to match the style used in leavesSide and ensure correctness.

Acceptance Criteria

  • contains is defined only once.
  • contains delegates to the static includes method.
  • Tests (if any) still pass.
tobiu added the bug label on Nov 23, 2025, 12:07 PM
tobiu added the ai label on Nov 23, 2025, 12:07 PM
tobiu added the refactoring label on Nov 23, 2025, 12:07 PM
tobiu assigned to @tobiu on Nov 23, 2025, 12:12 PM
tobiu referenced in commit ab304fe - "Remove duplicate contains() method in Rectangle.mjs #7874" on Nov 23, 2025, 12:13 PM
tobiu closed this issue on Nov 23, 2025, 12:13 PM