Skip to content

Conditional statement 'bug' #243

Description

@rasmuskt

General info

  • Version: 1.0.0-rc3

Issue
After reviewing the newest version of the code, the following conditional statement has an issue in the second case (line 921-922).

if (new_range_start_index >= old_range_start_index && old_range_end_index === new_range_end_index
|| new_range_end_index === old_range_end_index && old_range_end_index >= new_range_end_index) {

The second case new_range_end_index === old_range_end_index && old_range_end_index >= new_range_end_index equals comparison does not make sense . The intention of the case is to test for 'near top', to mirror the case of 'near bottom'. By mistakenly referring to the end-ranges in the equals comparison, it fails to be a 'near top' test, and instead sort of nullifies the second case.

Fix
The second case should instead be changed to new_range_start_index === old_range_start_index && old_range_end_index >= new_range_end_index

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions